blob: d26d7e1f35da2e16ab3495e4641c224c8bc663e8 (
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
|
--TEST--
Bug #71202 (Autoload function registered by another not activated immediately)
--FILE--
<?php
function inner_autoload ($name){
if ($name == 'A') {
class A {
function __construct(){
echo "okey, ";
}
}
} else {
class B {
function __construct() {
die("error");
}
}
}
}
spl_autoload_register(function ($name) {
if ($name == 'A') {
spl_autoload_register("inner_autoload");
} else {
spl_autoload_unregister("inner_autoload");
}
});
$c = new A();
try {
$c = new B();
} catch (Error $e) {
echo "done";
}
?>
--EXPECT--
okey, done
|