bug54043.phpt 449 B

1234567891011121314151617181920
  1. --TEST--
  2. Bug #54043: Remove inconsitency of internal exceptions and user defined exceptions
  3. --FILE--
  4. <?php
  5. $time = '9999-11-33'; // obviously invalid ;-)
  6. $timeZone = new DateTimeZone('UTC');
  7. try {
  8. $dateTime = new DateTime($time, $timeZone);
  9. } catch (Exception $e) {
  10. var_dump($e->getMessage());
  11. }
  12. var_dump(error_get_last());
  13. ?>
  14. --EXPECT--
  15. string(80) "Failed to parse time string (9999-11-33) at position 9 (3): Unexpected character"
  16. NULL