bug65322.phpt 595 B

123456789101112131415161718192021222324
  1. --TEST--
  2. Bug #65322: compile time errors won't trigger auto loading
  3. --FILE--
  4. <?php
  5. spl_autoload_register(function($class) {
  6. var_dump($class);
  7. class X {}
  8. });
  9. set_error_handler(function($_, $msg, $file) {
  10. var_dump($msg, $file);
  11. new X;
  12. });
  13. /* This is just a particular example of a non-fatal compile-time error
  14. * If this breaks in future, just find another example and use it instead */
  15. eval('class A { private function __invoke() { } }');
  16. ?>
  17. --EXPECTF--
  18. string(%d) "The magic method A::__invoke() must have public visibility"
  19. string(%d) "%s(%d) : eval()'d code"
  20. string(1) "X"