bug65322.phpt 631 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 { function test() { } } class B extends A { function test($a) { } }');
  16. ?>
  17. --EXPECTF--
  18. string(62) "Declaration of B::test($a) should be compatible with A::test()"
  19. string(%d) "%s(%d) : eval()'d code"
  20. string(1) "X"