exception_021.phpt 425 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 TypeError: Error::__construct(): Argument #1 ($message) must be of type string, stdClass given in %s:%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