exception_018.phpt 437 B

123456789101112131415
  1. --TEST--
  2. Testing throw exception doesn't crash with wrong params, variant 1
  3. --FILE--
  4. <?php
  5. class Hello extends Exception {}
  6. throw new Hello(new stdClass);
  7. ?>
  8. --EXPECTF--
  9. Fatal error: Uncaught TypeError: Exception::__construct(): Argument #1 ($message) must be of type string, stdClass given in %s:%d
  10. Stack trace:
  11. #0 %sexception_018.php(%d): Exception->__construct(Object(stdClass))
  12. #1 {main}
  13. thrown in %sexception_018.php on line %d