php-src/ext/opcache/tests/bug78937_1.phpt
Nikita Popov b1b0c81e39 Don't print preload warning for non-top-level classes
Dynamically declared classes categorically do not get linked during
preloading, even if all their dependencies are known. The warning
is misleading in this case, and there isn't anything the user can
do to address it.
2021-07-30 10:27:51 +02:00

24 lines
523 B
PHP

--TEST--
Bug #78937.1 (Preloading unlinkable anonymous class can segfault)
--INI--
opcache.enable=1
opcache.enable_cli=1
opcache.optimization_level=-1
opcache.preload={PWD}/preload_bug78937.inc
--EXTENSIONS--
opcache
--SKIPIF--
<?php
if (PHP_OS_FAMILY == 'Windows') die('skip Preloading is not supported on Windows');
?>
--FILE--
<?php
class Bar {
}
var_dump(foo());
?>
--EXPECTF--
Warning: Can't preload unlinked class Bar@anonymous: Unknown parent Bar in %spreload_bug78937.inc on line 3
object(Bar@anonymous)#%d (0) {
}