catchable_error_002.phpt 493 B

1234567891011121314151617181920212223242526272829
  1. --TEST--
  2. Catchable fatal error [2]
  3. --FILE--
  4. <?php
  5. class Foo {
  6. }
  7. function blah (Foo $a)
  8. {
  9. }
  10. function error()
  11. {
  12. $a = func_get_args();
  13. var_dump($a);
  14. }
  15. set_error_handler('error');
  16. try {
  17. blah (new StdClass);
  18. } catch (Error $ex) {
  19. echo $ex->getMessage(), "\n";
  20. }
  21. echo "ALIVE!\n";
  22. ?>
  23. --EXPECTF--
  24. blah(): Argument #1 ($a) must be of type Foo, stdClass given, called in %scatchable_error_002.php on line %d
  25. ALIVE!