php-vcr: Running the test suites will be failed with PHP 8.2 version

As title, it seems that the test suites will be failed with PHP 8.2 version. Here are steps to reproduce:

  • Installing the PHP 8.2 version.
  • Cloning the the php-vcr repository. And I ensure latest stable version also has this issue.
  • Installing the dependencies via the composer install command.
  • And run the vendor/bin/phpunit command.

Some outputs are as follows:

$ php -v
PHP 8.2.0 (cli) (built: Dec 10 2022 10:52:23) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.0, Copyright (c) Zend Technologies
    with Zend OPcache v8.2.0, Copyright (c), by Zend Technologies
$ git clone https://github.com/php-vcr/php-vcr
Cloning into 'php-vcr'...
remote: Enumerating objects: 5803, done.
remote: Counting objects: 100% (682/682), done.
remote: Compressing objects: 100% (281/281), done.
remote: Total 5803 (delta 377), reused 619 (delta 347), pack-reused 5121
Receiving objects: 100% (5803/5803), 1.10 MiB | 6.29 MiB/s, done.
Resolving deltas: 100% (3235/3235), done.
$ cd php-vcr/
$ php ~/composer.phar update
Loading composer repositories with package information
Info from https://repo.packagist.org: #StandWithUkraine
Updating dependencies
Lock file operations: 71 installs, 0 updates, 0 removals
  - Locking beberlei/assert (v3.3.2)
........
$ vendor/bin/phpunit
Segmentation fault (core dumped)

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 4
  • Comments: 39 (9 by maintainers)

Commits related to this issue

Most upvoted comments

I can confirm, with PHP 8.2.9 the issue is resolved (@see https://github.com/php-vcr/php-vcr/actions/runs/6041191644?pr=377). But now i’ve to fix some phpstan and phpcs errors. Maybe i’ll do later this night or this weekend. After that i’ll create a new release.

For others having this issue, this may be of use:

https://github.com/php/php-src/issues/11735

I built the fix from source and it fixed it in my minimal reproduction repo and it seemed to work as intended with no segfault.

I have just tried to clone down the project and checkout the 1.6.4 tag to run the phpunit testsuite on a PHP 8.2.3 NTS Release. And everything seems to be passing without any issues.

So it seems to me that we can support PHP 8.2 starting with 8.2.1.

Let me know if i should create a new pr in order to make sure the github action is running appropriately?

Resolved by #377

Can confirm, pinning to PHP v8.2.9 fixes the problems when generating coverage while using VCR!

I’d suggest the authors of this library allow PHP 8.2 again explicitly in a new release but ensure it’s 8.2.9+.

Further to my comment above 8.2.9 is available, and should solve the issue.

MacOs 13.4.1 php: 8.2.7

Running the unit tests fails with this exit error

Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)

I got them to pass by changing this line: https://github.com/php-vcr/php-vcr/blob/75735a6bd6808a97d950e690d302aba9e4ba7c58/tests/Unit/VCRTest.php#L21

to use an absolute path, instead of a relative path.

Looks like segfault does not occur with PHP 8.2.6. We are running VCR 1.6.4.

Can anyone else confirm PHP 8.2.6 is OK?

Hi, are here any updates yet or any progress internally? I face the same issue while upgrading a medium sized app to PHP 8.2. Is there anything I can provide to fix the issue?

@Justintime50 I think you are right. I am just lucky, or better said, my package is simple, with only 2 tests. On the VCR PHP 8.2 pull request PHP was 8.2.3 and php-vcr was 1.6.4 and there was a segfault. Edit: wait… are you recording SOAP requests? I am using only cURL.

Is pursuing adding support for PHP 8.2 something that can be reasonably done in the near future? We have multiple projects that are depending on this support - we are trying to gauge our options for next steps.