xref: /PHP-8.1/Zend/tests/bug54043.phpt (revision 2f1d0f2b)
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(80) "Failed to parse time string (9999-11-33) at position 9 (3): Unexpected character"
20NULL
21