mirror of
https://github.com/php/php-src.git
synced 2024-11-24 02:15:04 +08:00
c8fa477064
Same as with other exceptions during inheritance, convert those thrown during delayed class loading into fatal errors. We can't properly deal with such exceptions, as inheritance cannot be gracefully aborted at this point. Fixes oss-fuzz #39405.
21 lines
423 B
PHP
21 lines
423 B
PHP
--TEST--
|
|
Exception during delayed variance autoload (variation 2)
|
|
--FILE--
|
|
<?php
|
|
spl_autoload_register(function() {
|
|
class Y {}
|
|
throw new Exception;
|
|
});
|
|
class A {
|
|
function method(): object {}
|
|
}
|
|
class B extends A {
|
|
function method(): Y {}
|
|
}
|
|
?>
|
|
--EXPECTF--
|
|
Fatal error: During inheritance of B, while autoloading Y: Uncaught Exception in %s:%d
|
|
Stack trace:
|
|
#0 %s(%d): {closure}('Y')
|
|
#1 {main} in %s on line %d
|