diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2020-01-03 11:26:31 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-01-03 11:26:31 +0100 |
commit | 6f63e053201a5284d5b3ed2d2c369bb72500c345 (patch) | |
tree | 8c2fd015d1b6c53cfee1637ce5dd149caf80567b | |
parent | 3c2fcb717d5ffa80e422843b756110bd8d352b4b (diff) | |
download | php-git-6f63e053201a5284d5b3ed2d2c369bb72500c345.tar.gz |
Add test for bug #73816
This has been fixed by 0f2cdbf214efd98b4bdaf5ca41728faf00e7c037,
add the test case.
-rw-r--r-- | Zend/tests/bug73816.phpt | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/Zend/tests/bug73816.phpt b/Zend/tests/bug73816.phpt new file mode 100644 index 0000000000..aea392be5e --- /dev/null +++ b/Zend/tests/bug73816.phpt @@ -0,0 +1,24 @@ +--TEST-- +Bug #73816: Broken eval(anonymous class) +--FILE-- +<?php + +function anon() +{ + static $i = 0; + return eval(sprintf('return new class { private $prop%s; };', ++$i)); +} + +var_dump(anon()); +var_dump(anon()); + +?> +--EXPECT-- +object(class@anonymous)#1 (1) { + ["prop1":"class@anonymous":private]=> + NULL +} +object(class@anonymous)#1 (1) { + ["prop2":"class@anonymous":private]=> + NULL +} |