xref: /PHP-8.3/ext/spl/tests/spl_autoload_011.phpt (revision a555cc0b)
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--EXPECT--
27var:2
28bool(false)
29===DONE===
30__destruct__
31