mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
a555cc0b3d
Remove most of the `===DONE===` tags and its variations. Keep `===DONE===` if the test output otherwise becomes empty. Closes GH-4872.
42 lines
793 B
PHP
42 lines
793 B
PHP
--TEST--
|
|
ZE2 Autoload from destructor
|
|
--SKIPIF--
|
|
<?php
|
|
if (class_exists('autoload_root', false)) die('skip Autoload test classes exist already');
|
|
?>
|
|
--FILE--
|
|
<?php
|
|
|
|
spl_autoload_register(function ($class_name) {
|
|
var_dump(class_exists($class_name, false));
|
|
require_once(__DIR__ . '/' . $class_name . '.inc');
|
|
echo 'autoload(' . $class_name . ")\n";
|
|
});
|
|
|
|
var_dump(class_exists('autoload_derived', false));
|
|
var_dump(class_exists('autoload_derived', false));
|
|
|
|
class Test
|
|
{
|
|
function __destruct() {
|
|
echo __METHOD__ . "\n";
|
|
$o = new autoload_derived;
|
|
var_dump($o);
|
|
}
|
|
}
|
|
|
|
$o = new Test;
|
|
unset($o);
|
|
|
|
?>
|
|
--EXPECTF--
|
|
bool(false)
|
|
bool(false)
|
|
Test::__destruct
|
|
bool(false)
|
|
bool(false)
|
|
autoload(autoload_root)
|
|
autoload(autoload_derived)
|
|
object(autoload_derived)#%d (0) {
|
|
}
|