php-src/ext/spl/tests/spl_autoload_011.phpt
2008-05-25 12:17:27 +00:00

32 lines
471 B
PHP

--TEST--
SPL: spl_autoload() and object freed
--INI--
include_path=.
--FILE--
<?php
class A {
public $var = 1;
public function autoload() {
echo "var:".$this->var."\n";
}
public function __destruct() {
echo "__destruct__\n";
}
}
$a = new A;
$a->var = 2;
spl_autoload_register(array($a, 'autoload'));
unset($a);
var_dump(class_exists("C", true));
?>
===DONE===
<?php exit(0); ?>
--EXPECTF--
var:2
bool(false)
===DONE===
__destruct__