summaryrefslogtreecommitdiff
path: root/tests/lang/042.phpt
blob: ad6e081222d39861c739ae9ccae6efc2f7fb82d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
--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: Uncaught exception 'EngineException' with message 'Class 'B' not found' in %s042.php:%d
Stack trace:
#0 {main}
  thrown in %s042.php on line %d