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