1
0
mirror of https://github.com/php/php-src.git synced 2026-04-29 19:23:22 +02:00

Merge branch 'PHP-7.4'

This commit is contained in:
Nikita Popov
2019-07-04 11:07:14 +02:00
4 changed files with 28 additions and 0 deletions
+2
View File
@@ -3468,6 +3468,7 @@ static zend_bool preload_try_resolve_constants(zend_class_entry *ce)
zval *val;
EG(exception) = (void*)(uintptr_t)-1; /* prevent error reporting */
CG(in_compilation) = 1; /* prevent autoloading */
do {
ok = 1;
changed = 0;
@@ -3509,6 +3510,7 @@ static zend_bool preload_try_resolve_constants(zend_class_entry *ce)
}
} while (changed && !ok);
EG(exception) = NULL;
CG(in_compilation) = 0;
return ok;
}
+14
View File
@@ -0,0 +1,14 @@
--TEST--
No autoloading during constant resolution
--INI--
opcache.enable=1
opcache.enable_cli=1
opcache.optimization_level=-1
opcache.preload={PWD}/preload_const_autoload.inc
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
===DONE===
--EXPECTF--
Warning: Can't preload class Test with unresolved initializer for constant C in %s on line %d
===DONE===
@@ -0,0 +1,7 @@
<?php
spl_autoload_register(function($class) {
var_dump($class);
new Abc;
});
opcache_compile_file('preload_const_autoload_2.inc');
@@ -0,0 +1,5 @@
<?php
class Test {
const C = Foo::BAR;
}