#48058 [NEW]: DateTimeZone::getTransitions output different on 64 bit
| From: | wharmby at uk dot ibm dot com | Date: | Thu, 23 Apr 2009 08:57:58 +0000 |
| Subject: | #48058 [NEW]: DateTimeZone::getTransitions output different on 64 bit | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-136151@lists.php.net to get a copy of this message | ||
From: wharmby at uk dot ibm dot com
Operating system: Linux 64 bit
PHP version: 5.3CVS-2009-04-23 (snap)
PHP Bug Type: Date/time related
Bug description: DateTimeZone::getTransitions output different on 64 bit
Description:
------------
First entry in array returned by DateTimeZone method getTransitions (and
function timezone_transitions_get()looks bogus on 64 bit systems. I
expected same result when running this command on 32 and 64 bit systems.
Problem affects current levels of PHP 5.3 and 6.0 (snapshot timestamp ==
Wed 22-04-2009 6:30:00 ) only.
Looks like problem caused by use of constant LONG_MIN at around line 3218
in current src of ext/dates/date.c introduced by the following change:
=====================================================================
Revision 1.43.2.45.2.51.2.28 - (view) (download) (as text) (annotate) -
[select for diffs]
Thu Mar 20 19:43:36 2008 UTC (13 months ago) by derick
Branch: PHP_5_3
Changes since 1.43.2.45.2.51.2.27: +57 -24 lines
Diff to previous 1.43.2.45.2.51.2.27 , to branch point 1.43.2.45.2.51
- MFH: Fix the DateTimeZone::getTransitions() algorithm.
======================================================================
Reproduce code:
---------------
<?php
date_default_timezone_set("Europe/London");
$tz = new DateTimeZone("Europe/London");
$tran = $tz->getTransitions();
var_dump( $tran );
?>
Expected result:
----------------
(as produced by same code running on Linux 32 bits system)
array(243) {
[0]=>
array(5) {
["ts"]=>
int(-2147483648)
["time"]=>
string(24) "1901-12-13T20:45:52+0000"
["offset"]=>
int(3600)
["isdst"]=>
bool(true)
["abbr"]=>
string(3) "BST"
}
Actual result:
--------------
array(243) {
[0]=>
array(5) {
["ts"]=>
int(-9223372036854775808) <- == LONG_MIN
["time"]=>
string(30) "-219246529-01-27T08:29:52+0000" <- Bogus looking entry
["offset"]=>
int(3600)
["isdst"]=>
bool(true)
["abbr"]=>
string(3) "BST"
}
--
Edit bug report at http://bugs.php.net/?id=48058&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=48058&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=48058&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=48058&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=48058&r=fixedcvs
Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=48058&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=48058&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=48058&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=48058&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=48058&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=48058&r=support
Expected behavior: http://bugs.php.net/fix.php?id=48058&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=48058&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=48058&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=48058&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=48058&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=48058&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=48058&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=48058&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=48058&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=48058&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=48058&r=mysqlcfg