1
0
mirror of https://github.com/php/php-src.git synced 2026-03-26 01:02:25 +01:00
Files
archived-php-src/ext/spl/tests/bug73896.phpt
2020-07-10 21:05:28 +02:00

39 lines
804 B
PHP

--TEST--
Bug #73896 (spl_autoload() crashes when calls magic _call())
--FILE--
<?php
class Registrator {
public static function call($callable, array $args) {
return call_user_func_array($callable, [$args]);
}
}
class teLoader {
public function __construct() {
Registrator::call('spl_autoload_register', [$this, 'autoload']);
}
public function __call($method, $args) {
$this->doSomething();
}
protected function autoload($class) {
die("Protected autoload() called!\n");
}
public function doSomething() {
throw new teException();
}
}
$teLoader = new teLoader();
try {
new teChild();
} catch (Throwable $e) {
echo "Exception: ", $e->getMessage() , "\n";
}
?>
--EXPECT--
Exception: Class "teException" not found