xref: /PHP-8.0/Zend/tests/bug54043.phpt (revision 688b9136)
1--TEST--
2Bug #54043: Remove inconsitency of internal exceptions and user defined exceptions
3--FILE--
4<?php
5
6$time = '9999-11-33';	// obviously invalid ;-)
7$timeZone = new DateTimeZone('UTC');
8
9try {
10    $dateTime = new DateTime($time, $timeZone);
11} catch (Exception $e) {
12    var_dump($e->getMessage());
13}
14
15var_dump(error_get_last());
16
17?>
18--EXPECT--
19string(105) "DateTime::__construct(): Failed to parse time string (9999-11-33) at position 9 (3): Unexpected character"
20NULL
21