xref: /php-src/ext/spl/tests/bug48493.phpt (revision fc8426ad)
1--TEST--
2SPL: Bug #48493 spl_autoload_unregister() can't handle prepended functions
3--FILE--
4<?php
5function autoload1() {}
6
7function autoload2() {}
8
9spl_autoload_register('autoload2');
10spl_autoload_register('autoload1', true, true);
11var_dump(spl_autoload_functions());
12
13spl_autoload_unregister('autoload2');
14var_dump(spl_autoload_functions());
15?>
16--EXPECT--
17array(2) {
18  [0]=>
19  string(9) "autoload1"
20  [1]=>
21  string(9) "autoload2"
22}
23array(1) {
24  [0]=>
25  string(9) "autoload1"
26}
27