1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/Zend/tests/autoload/bug61011.phpt
DanielEScherzer d22abca488 Zend/tests: organize some tests with sub directories (5) (#17800)
Second pass through `Zend/tests/bug*` to organize the tests.

Move tests to existing sub directories, and create some new sub directories:
* `ArrayAccess`
* `autoload`
* `clone`
* `serialize` (also covers `unserialize()`)
* `switch`

Work towards GH-15631
2025-02-14 11:49:14 +00:00

38 lines
976 B
PHP

--TEST--
Bug #61011 (Crash when an exception is thrown by autoloader accessing a static property)
--FILE--
<?php
spl_autoload_register(function ($name) {
throw new Exception($name);
});
try {
echo AAA::$a; //zend_fetch_var_address_helper
} catch (Exception $e) {
try {
echo AAA::XXX; //ZEND_FETCH_CONSTANT
} catch (Exception $e) {
try {
echo AAA::foo(); //ZEND_INIT_STATIC_METHOD_CALL
} catch (Exception $e) {
try {
unset(AAA::$a); // ZEND_UNSET_VAR
} catch (Exception $e){
try {
isset(AAAA::$a); // ZEND_ISSET_ISEMPTY_VAR
} catch (Exception $e) {
try {
$a = array("AAA", "foo");
$a(); //ZEND_INIT_FCALL_BY_NAME
} catch (Exception $e) {
}
}
}
}
}
}
echo 'okey';
?>
--EXPECT--
okey