Closed
Description
Description
The following code:
ExampleEnum.php
<?php
enum ExampleEnum: string
{
case FIRST= 'FIRST_VALUE';
}
Trigger.php
<?php
function auxiliarFunction(string $enumEntry) {}
function triggerException(callable $callback) {
$callback();
}
function main() {
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