exception_004.phpt 334 B

123456789101112131415161718
  1. --TEST--
  2. Throwing exception using a class that isn't derived from the Exception base class
  3. --FILE--
  4. <?php
  5. error_reporting(E_ALL|E_STRICT);
  6. class Foo { }
  7. try {
  8. throw new Foo();
  9. } catch (Foo $e) {
  10. var_dump($e);
  11. }
  12. ?>
  13. --EXPECTF--
  14. Fatal error: Exceptions must be valid objects derived from the Exception base class in %s on line %d