php-src/Zend/tests/early_binding_unreachable.phpt
Nikita Popov c19977d054 Fix delayed early binding with optimization
It's possible for delayed early binding opcodes to get optimized
away if they are "unreachable". However, we still need to attempt
early binding for them. (In some cases we also corrupt the early
binding list outright during optimization, which is how I got here.)

Fix this by storing information about delayed early binding
independently of DECLARE_CLASS_DELAYED opcodes, so early binding is
performed even after the opcode has been dropped.
2021-09-29 18:00:20 +02:00

11 lines
169 B
PHP

--TEST--
Early bound class in otherwise unreachable code
--FILE--
<?php
class A {}
require __DIR__ . '/early_binding_unreachable.inc';
?>
--EXPECT--
object(B)#1 (0) {
}