mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
0600f513b3
Normally, we add classes without parents (and no interfaces or traits) directly to the class map, early binding the class. However, if the same class has already been registered, we would instead just add a ZEND_DECLARE_CLASS instruction and let the handler throw a duplicate class declaration exception. However, with opcache, if on the next request the files are included in the opposite order, we won't perform early binding. To fix this, create a ZEND_DECLARE_CLASS_DELAYED instruction instead and handle classes without parents accordingly, skipping any linking for classes that are already linked in delayed early binding. Fixes GH-8846
6 lines
59 B
PHP
6 lines
59 B
PHP
<?php
|
|
var_dump(Foo::BAR);
|
|
class Foo {
|
|
const BAR = true;
|
|
}
|