xref: /PHP-7.1/tests/lang/042.phpt (revision e97d5fab)
1--TEST--
2Dynamic access of constants
3--FILE--
4<?php
5class A {
6    const B = 'foo';
7}
8
9$classname       =  'A';
10$wrongClassname  =  'B';
11
12echo $classname::B."\n";
13echo $wrongClassname::B."\n";
14?>
15===DONE===
16--EXPECTF--
17foo
18
19Fatal error: Uncaught Error: Class 'B' not found in %s042.php:%d
20Stack trace:
21#0 {main}
22  thrown in %s042.php on line %d
23