php-src/ext/spl/tests/bug48493.phpt
Scott MacVicar fc8426ad31 MFH Fix bug #48493 - spl_autoload_register can leave the HT in an inconsistent way.
Need to point the second elements previous item to head so we can traverse upwards.
2009-06-09 01:58:07 +00:00

27 lines
480 B
PHP

--TEST--
SPL: Bug #48493 spl_autoload_unregister() can't handle prepended functions
--FILE--
<?php
function autoload1() {}
function autoload2() {}
spl_autoload_register('autoload2');
spl_autoload_register('autoload1', true, true);
var_dump(spl_autoload_functions());
spl_autoload_unregister('autoload2');
var_dump(spl_autoload_functions());
?>
--EXPECT--
array(2) {
[0]=>
string(9) "autoload1"
[1]=>
string(9) "autoload2"
}
array(1) {
[0]=>
string(9) "autoload1"
}