summaryrefslogtreecommitdiff
path: root/tests/lang/042.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lang/042.phpt')
-rw-r--r--tests/lang/042.phpt19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/lang/042.phpt b/tests/lang/042.phpt
new file mode 100644
index 0000000..217aab8
--- /dev/null
+++ b/tests/lang/042.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Dynamic access of constants
+--FILE--
+<?php
+class A {
+ const B = 'foo';
+}
+
+$classname = 'A';
+$wrongClassname = 'B';
+
+echo $classname::B."\n";
+echo $wrongClassname::B."\n";
+?>
+===DONE===
+--EXPECTF--
+foo
+
+Fatal error: Class 'B' not found in %s042.php on line %d