xref: /PHP-5.5/ext/spl/tests/spl_autoload_002.phpt (revision 610c7fbe)
1--TEST--
2SPL: spl_autoload_functions()
3--SKIPIF--
4<?php
5if (spl_autoload_functions() !== false) die('skip __autoload() registered by php.ini');
6?>
7--FILE--
8<?php
9
10function SplAutoloadTest1($name) {}
11function SplAutoloadTest2($name) {}
12
13var_dump(spl_autoload_functions());
14
15spl_autoload_register();
16
17var_dump(spl_autoload_functions());
18
19spl_autoload_register('SplAutoloadTest1');
20spl_autoload_register('SplAutoloadTest2');
21spl_autoload_register('SplAutoloadTest1');
22
23var_dump(spl_autoload_functions());
24
25spl_autoload_unregister('SplAutoloadTest1');
26
27var_dump(spl_autoload_functions());
28
29spl_autoload_unregister('spl_autoload_call');
30
31var_dump(spl_autoload_functions());
32
33spl_autoload_register();
34
35var_dump(spl_autoload_functions());
36
37spl_autoload_unregister('spl_autoload');
38
39var_dump(spl_autoload_functions());
40
41?>
42===DONE===
43<?php exit(0); ?>
44--EXPECT--
45bool(false)
46array(1) {
47  [0]=>
48  string(12) "spl_autoload"
49}
50array(3) {
51  [0]=>
52  string(12) "spl_autoload"
53  [1]=>
54  string(16) "SplAutoloadTest1"
55  [2]=>
56  string(16) "SplAutoloadTest2"
57}
58array(2) {
59  [0]=>
60  string(12) "spl_autoload"
61  [1]=>
62  string(16) "SplAutoloadTest2"
63}
64bool(false)
65array(1) {
66  [0]=>
67  string(12) "spl_autoload"
68}
69bool(false)
70===DONE===
71