Edit report at https://bugs.php.net/bug.php?id=66985&edit=1
ID: 66985
Updated by: rasmus@php.net
Reported by: evert at rooftopsolutions dot nl
Summary: Some timezones are no longer valid in PHP 5.5.10
Status: Not a bug
Type: Bug
Package: Date/time related
Operating System: Any
PHP Version: 5.5.10
Block user comment: N
Private report: N
New Comment:
I agree this shouldn't have been changed in a minor version. For better or worse, there is a
lot of EST5EDT and other POSIX tz identifiers out there being used interchangeably with Olson
identifiers. If Olson lists it, I think we should support it and if we are going to drop some we
should add warnings and in the current version and then drop them only in the next major version.
Previous Comments:
------------------------------------------------------------------------
[2014-03-31 14:57:46] evert at rooftopsolutions dot nl
Hey Derick,
They worked, because they are part of the olson file, and they are documented on the php site: https://php.net/manual/en/timezones.others.php
Furthermore, I'm using these, not in my code, but because I'm receiving timezone strings
from various sources that I can't control. This one came from a c library (libical) from some
system that had it's system timezone likely set to EST5EDT.
While I don't disagree that neither I nor anyone else should be using these, you introduced a
BC break in a minor PHP version of a documented feature, without as much as a mention in the
changelog.
That, to me, sounds like a bug.
------------------------------------------------------------------------
[2014-03-31 10:00:46] derick@php.net
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions. Due to the volume
of reports we can not explain in detail here why your report is not
a bug. The support channels will be able to provide an explanation
for you.
Thank you for your interest in PHP.
You're right. Those no longer work. But you're also right that you used a
"feature" that you shouldn't have. Those names are not "timezones", but
rather country names (or weird BC entries). It surprises me that they worked in the first place!
------------------------------------------------------------------------
[2014-03-30 22:25:47] evert at rooftopsolutions dot nl
Here's a full list of timezones that are not supported on PHP 5.5.10:
CST6CDT
Cuba
Egypt
Eire
EST5EDT
Factory
GB-Eire
GMT0
Greenwich
Hongkong
Iceland
Iran
Israel
Jamaica
Japan
Kwajalein
Libya
MST7MDT
Navajo
NZ-CHAT
Poland
Portugal
PST8PDT
Singapore
Turkey
Universal
W-SU
------------------------------------------------------------------------
[2014-03-30 20:13:50] evert at rooftopsolutions dot nl
Description:
------------
Sample code attached. Note that this worked before 5.5.10.
Perhaps I took advantage of a feature that was not supposed to be supported, in which case I would
definitely appreciate a workaround that works pre and post 5.5.10 :)
Test script:
---------------
php -r "echo (new DateTimeZone('EST5EDT'))->getName();";
Expected result:
----------------
EST5EDT
Actual result:
--------------
Fatal error: Uncaught exception 'Exception' with message
'DateTimeZone::__construct(): Unknown or bad timezone (EST5EDT)' in Command line code on
line 1
Exception: DateTimeZone::__construct(): Unknown or bad timezone (EST5EDT) in Command line code on
line 1
Call Stack:
0.0001 221064 1. {main}() Command line code:0
0.0001 221296 2. DateTimeZone->__construct() Command line code:1
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=66985&edit=1