1
0
mirror of https://github.com/php/php-src.git synced 2026-03-26 17:22:15 +01:00
Files
archived-php-src/tests/lang/042.phpt
2015-05-17 17:31:43 -05:00

23 lines
344 B
PHP

--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 Error: Class 'B' not found in %s042.php:%d
Stack trace:
#0 {main}
thrown in %s042.php on line %d