bug47714.phpt 512 B

123456789101112131415161718192021222324252627
  1. --TEST--
  2. Testing lambda function in set_exception_handler()
  3. --FILE--
  4. <?php
  5. function au($class) {
  6. eval('class handler {
  7. function handle($e) {
  8. echo $e->getMessage()."\n";
  9. }
  10. }');
  11. }
  12. function __autoload($class) {
  13. au($class);
  14. }
  15. //spl_autoload_register('au');
  16. set_exception_handler(function($exception) {
  17. $h = new handler();
  18. $h->handle($exception);
  19. });
  20. throw new Exception('exception');
  21. ?>
  22. --EXPECT--
  23. exception