Bug #67866 [NEW]: Incompataility Between PHP 5.4.29 And 5.4.30+

From: Date: Tue, 19 Aug 2014 15:16:36 +0000
Subject: Bug #67866 [NEW]: Incompataility Between PHP 5.4.29 And 5.4.30+
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-187181@lists.php.net to get a copy of this message
From: graham at mineuk dot com Operating system: PHP version: 5.4.31 Package: Date/time related Bug Type: Bug Bug description:Incompataility Between PHP 5.4.29 And 5.4.30+ Description: ------------ The following code: ``` <?php $dt = new DateTime(); $dt->setTimestamp(1234567890); var_dump($dt->modify('4 year')); ``` results in the following in php 5.4.29: ``` object(DateTime)#1 (3) { ["date"]=> string(19) "2013-02-14 00:31:30" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } ``` but in php 5.4.30 and 5.4.31: ``` object(DateTime)#1 (3) { ["date"]=> string(26) "2013-02-14 00:31:30.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } ``` Test script: --------------- <?php $dt = new DateTime(); $dt->setTimestamp(1234567890); var_dump($dt->modify('4 year')); Expected result: ---------------- object(DateTime)#1 (3) { ["date"]=> string(19) "2013-02-14 00:31:30" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Actual result: -------------- object(DateTime)#1 (3) { ["date"]=> string(26) "2013-02-14 00:31:30.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } -- Edit bug report at https://bugs.php.net/bug.php?id=67866&edit=1 --

« previous php.bugs (#187181) next »