Annotation of embedaddon/php/ext/spl/tests/spl_autoload_bug48541.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: SPL: spl_autoload_register() Bug #48541: registering multiple closures fails with memleaks
3: --FILE--
4: <?php
5:
6: class X {
7: public function getClosure() {
8: return function($class) {
9: echo "a2 called\n";
10: };
11: }
12: }
13:
14: $a = function ($class) {
15: echo "a called\n";
16: };
17: $x = new X;
18: $a2 = $x->getClosure();
19: $b = function ($class) {
20: eval('class ' . $class . '{function __construct(){echo "foo\n";}}');
21: echo "b called\n";
22: };
23: spl_autoload_register($a);
24: spl_autoload_register($a2);
25: spl_autoload_register($b);
26:
27: $c = $a;
28: $c2 = $a2;
29: spl_autoload_register($c);
30: spl_autoload_register($c2);
31: $c = new foo;
32: ?>
33: ===DONE===
34: --EXPECT--
35: a called
36: a2 called
37: b called
38: foo
39: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>