xref: /PHP-5.5/ext/spl/tests/spl_autoload_011.phpt (revision 0cfdd9a7)
1--TEST--
2SPL: spl_autoload() and object freed
3--INI--
4include_path=.
5--FILE--
6<?php
7class A {
8    public $var = 1;
9    public function autoload() {
10        echo "var:".$this->var."\n";
11    }
12    public function __destruct() {
13        echo "__destruct__\n";
14    }
15}
16
17$a = new A;
18$a->var = 2;
19
20spl_autoload_register(array($a, 'autoload'));
21unset($a);
22
23var_dump(class_exists("C", true));
24?>
25===DONE===
26<?php exit(0); ?>
27--EXPECTF--
28var:2
29bool(false)
30===DONE===
31__destruct__
32