mirror of
https://github.com/php/php-src.git
synced 2024-11-24 18:34:21 +08:00
20 lines
280 B
PHP
20 lines
280 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: Class 'B' not found in %s042.php on line %d
|