042.phpt 280 B

12345678910111213141516171819
  1. --TEST--
  2. Dynamic access of constants
  3. --FILE--
  4. <?php
  5. class A {
  6. const B = 'foo';
  7. }
  8. $classname = 'A';
  9. $wrongClassname = 'B';
  10. echo $classname::B."\n";
  11. echo $wrongClassname::B."\n";
  12. ?>
  13. ===DONE===
  14. --EXPECTF--
  15. foo
  16. Fatal error: Class 'B' not found in %s042.php on line %d