diff options
author | Xinchen Hui <laruence@gmail.com> | 2016-07-14 13:36:43 +0800 |
---|---|---|
committer | Xinchen Hui <laruence@gmail.com> | 2016-07-14 13:36:43 +0800 |
commit | 8c5b27e0617bf0899d7e830ed3029711125a0ddb (patch) | |
tree | 2aa394b891024b750d616b02aad6f468b5558cf3 /Zend/tests/bug72594.phpt | |
parent | 61a2566dc9be62ee8de309496d2a81a12a99947a (diff) | |
download | php-git-8c5b27e0617bf0899d7e830ed3029711125a0ddb.tar.gz |
Fixed bug #72594 (Calling an earlier instance of an included anonymous class fatals)
Diffstat (limited to 'Zend/tests/bug72594.phpt')
-rw-r--r-- | Zend/tests/bug72594.phpt | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/Zend/tests/bug72594.phpt b/Zend/tests/bug72594.phpt new file mode 100644 index 0000000000..3e88b2e6d6 --- /dev/null +++ b/Zend/tests/bug72594.phpt @@ -0,0 +1,33 @@ +--TEST-- +Bug #72594 (Calling an earlier instance of an included anonymous class fatals) +--INI-- +opcache.enable=0 +--FILE-- +<?php +if (isset($runtime)) { + return new class { + public $bar; + public function bing($foo = null) { + if ($foo) $foo->bing(); + } + }; +} + +$runtime = 1; +$oldFoo = require(__FILE__); +$newFoo = require(__FILE__); + +var_dump(get_class_methods($oldFoo)); +var_dump(get_object_vars($oldFoo)); + +$newFoo->bing($oldFoo); +?> +--EXPECTF-- +array(1) { + [0]=> + string(4) "bing" +} +array(1) { + ["bar"]=> + NULL +} |