Bug #67675 [NEW]: DateTimeZone->getTransitions()->ts returns invalid value

From: Date: Thu, 24 Jul 2014 12:10:52 +0000
Subject: Bug #67675 [NEW]: DateTimeZone->getTransitions()->ts returns invalid value
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-186796@lists.php.net to get a copy of this message
From:             greenrover33 at gmail dot com
Operating system: Linux
PHP version:      5.5.15
Package:          Date/time related
Bug Type:         Bug
Bug description:DateTimeZone->getTransitions()->ts returns invalid value

Description:
------------
This ts is empty. Because its a to high/low number.
[ts] => -9223372036854775808 === empty($ts->ts)
[ts] => -9223372036854775808 === !isset($ts->ts)

Test script:
---------------
<?PHP
$tz = new DateTimeZone('Europe/Berlin');

foreach ($tz->getTransitions() as $ts) {
    if (empty($ts->ts)) {
        echo "HRERE is the bug\n";
        print_r($ts);  

        echo "\n\nfull log:\n";
        print_r($tz->getTransitions());
        die();
    }
}

echo "The bug was fixed";
die();


Expected result:
----------------
First row is:
Array
(
    [ts] => -9223372036854775808
    [time] => -292277022657-01-27T08:29:52+0000
    [offset] => 7200
    [isdst] => 1
    [abbr] => CEST
)

Actual result:
--------------
First row should be:

Array
(
    [ts] => -1693706400
    [time] => 1916-04-30T22:00:00+0000
    [offset] => 7200
    [isdst] => 1
    [abbr] => CEST
)


-- 
Edit bug report at https://bugs.php.net/bug.php?id=67675&edit=1
-- 



Thread (6 messages)

« previous php.bugs (#186796) next »