mirror of
https://github.com/php/php-src.git
synced 2025-01-07 11:34:09 +08:00
d836046ab8
It is very hard to determine in advance whether class linking will fail due to missing dependencies in variance checks (#7314 attempts this). This patch takes an alternative approach where we try to perform inheritance on a copy of the class (zend_lazy_class_load) and then restore the original class if inheritance fails. The fatal error in that case is recorded and thrown as a warning later. Closes GH-7319.
22 lines
563 B
PHP
22 lines
563 B
PHP
--TEST--
|
|
Handling of errors during linking
|
|
--INI--
|
|
opcache.enable=1
|
|
opcache.enable_cli=1
|
|
opcache.optimization_level=-1
|
|
opcache.preload={PWD}/preload_inheritance_error_ind.inc
|
|
--EXTENSIONS--
|
|
opcache
|
|
--SKIPIF--
|
|
<?php
|
|
if (PHP_OS_FAMILY == 'Windows') die('skip Preloading is not supported on Windows');
|
|
if (getenv('SKIP_ASAN')) die('xfail Startup failure leak');
|
|
?>
|
|
--FILE--
|
|
<?php
|
|
echo "Foobar\n";
|
|
?>
|
|
--EXPECTF--
|
|
Warning: Can't preload unlinked class B: Declaration of B::foo($bar) must be compatible with A::foo() in %spreload_inheritance_error.inc on line 8
|
|
Foobar
|