php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67866 Incompataility Between PHP 5.4.29 And 5.4.30+
Submitted: 2014-08-19 15:16 UTC Modified: 2014-12-30 10:42 UTC
Votes:6
Avg. Score:4.7 ± 0.5
Reproduced:6 of 6 (100.0%)
Same Version:4 (66.7%)
Same OS:4 (66.7%)
From: graham at mineuk dot com Assigned: derick (profile)
Status: No Feedback Package: Date/time related
PHP Version: 5.4.30, 5.5.14 OS:
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2014-08-19 15:16 UTC] graham at mineuk dot com
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" }

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-08-19 16:02 UTC] levim@php.net
-Assigned To: +Assigned To: derick
 [2014-08-19 17:14 UTC] requinix@php.net
-PHP Version: 5.4.31 +PHP Version: 5.4.30, 5.5.14
 [2014-08-20 09:42 UTC] derick@php.net
I am not sure what the problem is. Not having microseconds in there was a bug.
 [2014-08-20 09:43 UTC] derick@php.net
-Status: Assigned +Status: Feedback
 [2014-11-10 16:00 UTC] lowwa132 at free dot fr
The format actually changes a lot of things. With a webservice for example, we need consistency between versions if we encode and provide DateTime directly in json.
 [2014-12-30 10:42 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Nov 28 21:03:16 2021 UTC