summaryrefslogtreecommitdiff
path: root/ext/spl/tests/spl_autoload_002.phpt
blob: 21caa43bfa099753db891c0ef888031c22efe898 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
--TEST--
SPL: spl_autoloadfunctions()
--SKIPIF--
<?php if (spl_autoload_functions() !== false) die('skip __autoload() registered by php.ini'); ?>
--FILE--
<?php

function SplAutoloadTest1($name) {}
function SplAutoloadTest2($name) {}

var_dump(spl_autoload_functions());

spl_autoload_register();

var_dump(spl_autoload_functions());

spl_autoload_register('SplAutoloadTest1');
spl_autoload_register('SplAutoloadTest2');
spl_autoload_register('SplAutoloadTest1');

var_dump(spl_autoload_functions());

spl_autoload_unregister('SplAutoloadTest1');

var_dump(spl_autoload_functions());

spl_autoload_unregister('spl_autoload_call');

var_dump(spl_autoload_functions());

spl_autoload_register();

var_dump(spl_autoload_functions());

spl_autoload_unregister('spl_autoload');

var_dump(spl_autoload_functions());

?>
===DONE===
<?php exit(0); ?>
--EXPECT--
bool(false)
array(1) {
  [0]=>
  string(12) "spl_autoload"
}
array(3) {
  [0]=>
  string(12) "spl_autoload"
  [1]=>
  string(16) "SplAutoloadTest1"
  [2]=>
  string(16) "SplAutoloadTest2"
}
array(2) {
  [0]=>
  string(12) "spl_autoload"
  [1]=>
  string(16) "SplAutoloadTest2"
}
bool(false)
array(1) {
  [0]=>
  string(12) "spl_autoload"
}
bool(false)
===DONE===