bug66251.phpt 413 B

1234567891011121314151617181920
  1. --TEST--
  2. Bug #66251 (Constants get statically bound at compile time when Optimized)
  3. --INI--
  4. opcache.enable=1
  5. opcache.enable_cli=1
  6. opcache.optimization_level=-1
  7. --EXTENSIONS--
  8. opcache
  9. --FILE--
  10. <?php
  11. printf ("A=%s\n", getA());
  12. const A="hello";
  13. function getA() {return A;}
  14. ?>
  15. --EXPECTF--
  16. Fatal error: Uncaught Error: Undefined constant "A" in %s:%d
  17. Stack trace:
  18. #0 %s(%d): getA()
  19. #1 {main}
  20. thrown in %s on line %d