diff options
author | Remi Collet <remi@php.net> | 2014-06-05 13:45:57 +0200 |
---|---|---|
committer | Remi Collet <remi@php.net> | 2014-06-05 13:45:57 +0200 |
commit | 9ea9064779a0de96079755694688a136487ba160 (patch) | |
tree | c3327e95141960a67ef718b82c3b9b36a27f2c66 /ext/date/tests | |
parent | 4b4a5bc1d367fc22528173f8b083eac3a2c29b60 (diff) | |
parent | 3f47368738fe9123fb1b0a5d543ac7607295951d (diff) | |
download | php-git-9ea9064779a0de96079755694688a136487ba160.tar.gz |
Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
NEWS
Fix regression introduce in fix for bug #67118
Diffstat (limited to 'ext/date/tests')
-rw-r--r-- | ext/date/tests/bug67118.phpt | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/ext/date/tests/bug67118.phpt b/ext/date/tests/bug67118.phpt index 6371757647..973b4eb8d5 100644 --- a/ext/date/tests/bug67118.phpt +++ b/ext/date/tests/bug67118.phpt @@ -1,5 +1,5 @@ --TEST-- -Bug #67118 php-cgi crashes regularly on IIS 7 +Bug #67118 crashes in DateTime when this used after failed __construct --INI-- date.timezone=Europe/Berlin --FILE-- @@ -11,17 +11,17 @@ class mydt extends datetime if (!empty($tz) && !is_object($tz)) { $tz = new DateTimeZone($tz); } - - @parent::__construct($time, $tz); + try { + @parent::__construct($time, $tz); + } catch (Exception $e) { + echo "Bad date" . $this->format("Y") . "\n"; + } } }; new mydt("Funktionsansvarig rÄdgivning och juridik", "UTC"); +?> --EXPECTF-- -Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (Funktionsansvarig rÄdgivning och juridik) at position 0 (F): The timezone could not be found in the database' in %sbug67118.php:%d -Stack trace: -#0 %sbug67118.php(%d): DateTime->__construct('Funktionsansvar...', Object(DateTimeZone)) -#1 %sbug67118.php(%d): mydt->__construct('Funktionsansvar...', 'UTC') -#2 {main} - thrown in %sbug67118.php on line %d +Warning: DateTime::format(): The DateTime object has not been correctly initialized by its constructor in %sbug67118.php on line %d +Bad date |