summaryrefslogtreecommitdiff
path: root/Zend/tests/bug74657.phpt
diff options
context:
space:
mode:
authorXinchen Hui <laruence@gmail.com>2017-05-27 12:06:43 +0800
committerXinchen Hui <laruence@gmail.com>2017-05-27 12:06:43 +0800
commit5269c4cacbc1372341d2091337d87fa3b0181490 (patch)
tree3ff8ef420714900f1a60a91f2f6938b8d53edc18 /Zend/tests/bug74657.phpt
parent872e43d6e55e4af84681b259198ee688287cd40d (diff)
downloadphp-git-5269c4cacbc1372341d2091337d87fa3b0181490.tar.gz
Fixed bug #74657 (Undefined constants in array properties result in broken properties)
Diffstat (limited to 'Zend/tests/bug74657.phpt')
-rw-r--r--Zend/tests/bug74657.phpt26
1 files changed, 26 insertions, 0 deletions
diff --git a/Zend/tests/bug74657.phpt b/Zend/tests/bug74657.phpt
new file mode 100644
index 0000000000..41e28ce58b
--- /dev/null
+++ b/Zend/tests/bug74657.phpt
@@ -0,0 +1,26 @@
+--TEST--
+Bug #74657 (Undefined constants in array properties result in broken properties)
+--FILE--
+<?php
+
+interface I {
+}
+
+class C {
+ const FOO = I::FOO;
+
+ public $options = [self::FOO => "bar"];
+}
+
+try {
+ var_dump((new C)->options);
+} catch (Throwable $e) {}
+
+var_dump((new C)->options);
+?>
+--EXPECTF--
+Fatal error: Uncaught Error: Undefined class constant 'I::FOO' in %sbug74657.php:%d
+Stack trace:
+#0 {main}
+ thrown in %sbug74657.php on line %d
+