mirror of
https://github.com/php/php-src.git
synced 2025-01-06 10:53:39 +08:00
23 lines
344 B
PHP
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
|