- Notifications
You must be signed in to change notification settings - Fork8k
Closed
Description
Description
The following code:
ExampleEnum.php
<?phpenum ExampleEnum:string{caseFIRST='FIRST_VALUE';}
Trigger.php
<?phpfunctionauxiliarFunction(string$enumEntry) {}functiontriggerException(callable$callback) {$callback();}functionmain() {triggerException(function () {auxiliarFunction(ExampleEnum::FIRST->value);//This will not run and trigger a SIGSEGV - core dumped });}
This was first spotted on Symfony 5.4 codebase, with a callback of the TagAwareCacheInterface.
If OPCache is disabled, the error doesn't occur.
Replacing the enum with a string variable fixes the issue.
PHP Version
PHP 8.1.11 (fpm-fcgi)
Operating System
Ubuntu 20.04.5 LTS