Bug #66102 [NEW]: DateTimeZone::listIdentifiers does not return linked timezone

From: Date: Fri, 15 Nov 2013 12:23:55 +0000
Subject: Bug #66102 [NEW]: DateTimeZone::listIdentifiers does not return linked timezone
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-182774@lists.php.net to get a copy of this message
From: a dot servedio at technotraffic dot com Operating system: Linux, might be any PHP version: Irrelevant Package: Date/time related Bug Type: Bug Bug description:DateTimeZone::listIdentifiers does not return linked timezone Description: ------------ America/Montreal timezone was changed from a distinct timezone (entry in zone.tab) to a linked timezone (linked to America/Toronto). This change comes from a iana update (2013e) introduced in september 2013. But other previous "linked" timezone don't show up in listIdentifiers as well. While not being a distinct timezone, these are still valid (See comment from TZ Maintainer at iana: https://github.com/eggert/tz/commit/45dcf69b45087cff50282d4da64b86a7d705ddf3#commitcomment-4602830) (issue occurs in both 5.3.10 and 5.5.5 as far as I know) Test script: --------------- // all valid timezones, except last 2 are timezone "links" $timezones = array('America/Toronto', 'America/Montreal', 'Asia/Istanbul'); // they are all valid here. No Exceptions thrown foreach($timezones as $tz) { new \DateTimeZone($tz); echo "Timezone object valid with $tz \n"; } // checking against identifiers list, will not find it for the last 2 timezones $tz_list = \DateTimeZone::listIdentifiers(); foreach($timezones as $tz) { echo "Timezone $tz "; echo in_array($tz, $tz_list) ? "in list\n" : "NOT in list\n"; } Expected result: ---------------- Timezone object valid with America/Toronto Timezone object valid with America/Montreal Timezone object valid with Asia/Istanbul Timezone America/Toronto in list Timezone America/Montreal in list Timezone Asia/Istanbul in list Actual result: -------------- Timezone object valid with America/Toronto Timezone object valid with America/Montreal Timezone object valid with Asia/Istanbul Timezone America/Toronto in list Timezone America/Montreal NOT in list Timezone Asia/Istanbul NOT in list -- Edit bug report at https://bugs.php.net/bug.php?id=66102&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=66102&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=66102&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=66102&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=66102&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=66102&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=66102&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=66102&r=needscript Try newer version: https://bugs.php.net/fix.php?id=66102&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=66102&r=support Expected behavior: https://bugs.php.net/fix.php?id=66102&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=66102&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=66102&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=66102&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=66102&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=66102&r=dst IIS Stability: https://bugs.php.net/fix.php?id=66102&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=66102&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=66102&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=66102&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=66102&r=mysqlcfg

« previous php.bugs (#182774) next »