exception_021.phpt 446 B

123456789101112131415
  1. --TEST--
  2. Testing throw exception doesn't crash with wrong params, variant 3
  3. --FILE--
  4. <?php
  5. class Hello extends Error {}
  6. throw new Hello(new stdClass);
  7. ?>
  8. --EXPECTF--
  9. Fatal error: Uncaught Error: Wrong parameters for Hello([string $message [, long $code [, Throwable $previous = NULL]]]) in %sexception_021.php:%d
  10. Stack trace:
  11. #0 %sexception_021.php(%d): Error->__construct(Object(stdClass))
  12. #1 {main}
  13. thrown in %sexception_021.php on line %d