2012-12-14 08:51:34 +00:00
|
|
|
--TEST--
|
|
|
|
Bug #63741 (Crash when autoloading from spl)
|
|
|
|
--FILE--
|
|
|
|
<?php
|
2019-03-15 21:55:30 +00:00
|
|
|
file_put_contents(__DIR__."/bug63741.tmp.php",
|
2012-12-14 08:51:34 +00:00
|
|
|
<<<'EOT'
|
|
|
|
<?php
|
|
|
|
if (isset($autoloading))
|
|
|
|
{
|
|
|
|
class ClassToLoad
|
|
|
|
{
|
|
|
|
static function func ()
|
|
|
|
{
|
|
|
|
print "OK!\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
class autoloader
|
|
|
|
{
|
|
|
|
static function autoload($classname)
|
|
|
|
{
|
|
|
|
print "autoloading...\n";
|
|
|
|
$autoloading = true;
|
|
|
|
include __FILE__;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
spl_autoload_register(["autoloader", "autoload"]);
|
|
|
|
|
|
|
|
function start()
|
|
|
|
{
|
|
|
|
ClassToLoad::func();
|
|
|
|
}
|
|
|
|
|
|
|
|
start();
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
EOT
|
|
|
|
);
|
|
|
|
|
2019-03-15 21:55:30 +00:00
|
|
|
include __DIR__."/bug63741.tmp.php";
|
2012-12-14 08:51:34 +00:00
|
|
|
?>
|
|
|
|
--CLEAN--
|
2019-03-15 21:55:30 +00:00
|
|
|
<?php unlink(__DIR__."/bug63741.tmp.php"); ?>
|
2012-12-14 08:51:34 +00:00
|
|
|
--EXPECT--
|
|
|
|
autoloading...
|
|
|
|
OK!
|