xref: /PHP-7.4/Zend/tests/bug72594.phpt (revision ded3d984)
1--TEST--
2Bug #72594 (Calling an earlier instance of an included anonymous class fatals)
3--INI--
4opcache.enable=0
5--FILE--
6<?php
7if (isset($runtime)) {
8	return new class {
9		public $bar;
10		public function bing($foo = null) {
11			if ($foo) $foo->bing();
12		}
13	};
14}
15
16$runtime = 1;
17$oldFoo = require(__FILE__);
18$newFoo = require(__FILE__);
19
20var_dump(get_class_methods($oldFoo));
21var_dump(get_object_vars($oldFoo));
22
23$newFoo->bing($oldFoo);
24?>
25--EXPECT--
26array(1) {
27  [0]=>
28  string(4) "bing"
29}
30array(1) {
31  ["bar"]=>
32  NULL
33}
34