-
Notifications
You must be signed in to change notification settings - Fork 8k
Closed as not planned
Description
Description
The following code:
<?php
echo "this should be called twice!\n";
class Example {} // will be redeclared
if (defined("test")) {
echo "end\n";
} else {
define("test", 1);
echo("now include myself\n");
include(__FILE__);
}
?>
Resulted in this output:
this should be called twice!
now include myself
Fatal error: Cannot redeclare class Example (previously declared in /tmp/x.php:4) in /tmp/x.php on line 4
But I expected this output instead:
this should be called twice!
now include myself
this should be called twice!
Fatal error: Cannot redeclare class Example (previously declared in /tmp/x.php:4) in /tmp/x.php on line 4
To reproduce:
-d "zend_extension=/php-src/modules/opcache.so" -d "opcache.enable_cli=1" -d "opcache.enable=1"
It seems the error goes before the next execution in JIT so that it does not echo twice?
PHP Version
nightly
Operating System
ubuntu 22.04