Skip to content

Commit 359d91a

Browse files
committed
Add test for bug #63741
1 parent e65b966 commit 359d91a

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

Zend/tests/bug63741.phpt

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
--TEST--
2+
Bug #63741 (Crash when autoloading from spl)
3+
--FILE--
4+
<?php
5+
file_put_contents(dirname(__FILE__)."/bug63741.tmp.php",
6+
<<<'EOT'
7+
<?php
8+
if (isset($autoloading))
9+
{
10+
class ClassToLoad
11+
{
12+
static function func ()
13+
{
14+
print "OK!\n";
15+
}
16+
}
17+
return;
18+
}
19+
else
20+
{
21+
class autoloader
22+
{
23+
static function autoload($classname)
24+
{
25+
print "autoloading...\n";
26+
$autoloading = true;
27+
include __FILE__;
28+
}
29+
}
30+
31+
spl_autoload_register(["autoloader", "autoload"]);
32+
33+
function start()
34+
{
35+
ClassToLoad::func();
36+
}
37+
38+
start();
39+
}
40+
?>
41+
EOT
42+
);
43+
44+
include dirname(__FILE__)."/bug63741.tmp.php";
45+
?>
46+
--CLEAN--
47+
<?php unlink(dirname(__FILE__)."/bug63741.tmp.php"); ?>
48+
--EXPECT--
49+
autoloading...
50+
OK!

0 commit comments

Comments
 (0)