1--TEST-- 2ZE2 Autoload from destructor 3--SKIPIF-- 4<?php 5 if (class_exists('autoload_root', false)) die('skip Autoload test classes exist already'); 6?> 7--FILE-- 8<?php 9 10spl_autoload_register(function ($class_name) { 11 var_dump(class_exists($class_name, false)); 12 require_once(dirname(__FILE__) . '/' . $class_name . '.p5c'); 13 echo 'autoload(' . $class_name . ")\n"; 14}); 15 16var_dump(class_exists('autoload_derived', false)); 17var_dump(class_exists('autoload_derived', false)); 18 19class Test 20{ 21 function __destruct() { 22 echo __METHOD__ . "\n"; 23 $o = new autoload_derived; 24 var_dump($o); 25 } 26} 27 28$o = new Test; 29unset($o); 30 31?> 32===DONE=== 33--EXPECTF-- 34bool(false) 35bool(false) 36Test::__destruct 37bool(false) 38bool(false) 39autoload(autoload_root) 40autoload(autoload_derived) 41object(autoload_derived)#%d (0) { 42} 43===DONE=== 44