Bug #66985 [Opn->Nab]: Some timezones are no longer valid in PHP 5.5.10

From: Date: Mon, 31 Mar 2014 10:00:47 +0000
Subject: Bug #66985 [Opn->Nab]: Some timezones are no longer valid in PHP 5.5.10
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-184977@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=66985&edit=1

 ID:                 66985
 Updated by:         derick@php.net
 Reported by:        evert at rooftopsolutions dot nl
 Summary:            Some timezones are no longer valid in PHP 5.5.10
-Status:             Open
+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:

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!


Previous Comments:
------------------------------------------------------------------------
[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


Thread (18 messages)

« previous php.bugs (#184977) next »