|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2014-03-07 13:33 UTC] thekid@php.net
Description:
------------
timezone_open() behaviour has changed between PHP 5.5 and PHP 5.6
Test script:
---------------
$ php -ddate.timezone=Europe/Berlin -r 'var_dump(timezone_open("CEST"));'
Expected result:
----------------
object(DateTimeZone)#1 (2) {
["timezone_type"]=>
int(3)
["timezone"]=>
string(13) "Europe/Berlin"
}
Actual result:
--------------
object(DateTimeZone)#1 (2) {
["timezone_type"]=>
int(2)
["timezone"]=>
string(4) "CEST"
}
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 07 12:00:02 2026 UTC |
@derick - what you can't see as my reproducing script doesn't include it is that the "deprecated" identifier is returned from a call to timezone_transitions_get() in the first place: php -ddate.timezone=Europe/Berlin -r 'var_dump(timezone_transitions_get(timezone_open("Europe/Berlin")));' array(145) { ... [143]=> array(5) { ["ts"]=> int(2121901200) ["time"]=> string(24) "2037-03-29T01:00:00+0000" ["offset"]=> int(7200) ["isdst"]=> bool(true) ["abbr"]=> string(4) "CEST" } [144]=> array(5) { ["ts"]=> int(2140045200) ["time"]=> string(24) "2037-10-25T01:00:00+0000" ["offset"]=> int(3600) ["isdst"]=> bool(false) ["abbr"]=> string(3) "CET" } } One could regard this as a bug in that function then.