php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #68406 calling var_dump on a DateTimeZone object modifies it
Submitted: 2014-11-11 20:48 UTC Modified: 2014-11-18 19:38 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: derick@php.net Assigned:
Status: Closed Package: Date/time related
PHP Version: 5.6.2 OS: *
Private report: No CVE-ID: None
 [2014-11-11 20:48 UTC] derick@php.net
Description:
------------
Originally, http://bugs.xdebug.org/view.php?id=1081, but really a PHP bug. Calling var_dump() on a DateTimeZone object modifies it in some circumstances.

Test script:
---------------
<?php

$tz1 = new DateTimeZone('Europe/Berlin');
$tz2 = new DateTimeZone('Europe/Berlin');

$d = new DateTime('2014-12-24 13:00:00', $tz1);
var_dump($d->getTimezone(), $tz2);

if($tz2 == $d->getTimezone()) {
    echo "yes";
}
else {
    echo "no";
}


Expected result:
----------------
yes

Actual result:
--------------
no

Patches

Pull Requests

Pull requests:

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-11-17 14:46 UTC] fmargaine@php.net
-Assigned To: +Assigned To: fmargaine
 [2014-11-18 19:38 UTC] fmargaine@php.net
-Assigned To: fmargaine +Assigned To:
 [2018-02-12 08:20 UTC] krakjoe@php.net
Automatic comment on behalf of jhdxr
Revision: http://git.php.net/?p=php-src.git;a=commit;h=070211b3e3b2fc20247e761e3bf2a81b50b6e007
Log: Fixed bug #68406 calling var_dump on a DateTimeZone object modifies it
 [2018-02-12 08:20 UTC] krakjoe@php.net
-Status: Open +Status: Closed
 [2018-02-12 08:20 UTC] krakjoe@php.net
Automatic comment on behalf of jhdxr
Revision: http://git.php.net/?p=php-src.git;a=commit;h=51f2a5803fa4f09e212fed4b14ab8b4a003d4ef5
Log: Fixed bug #68406 calling var_dump on a DateTimeZone object modifies it
 [2018-02-12 08:20 UTC] krakjoe@php.net
Automatic comment on behalf of jhdxr
Revision: http://git.php.net/?p=php-src.git;a=commit;h=766271a10588a4e58054ae9c17b2d56b68020879
Log: fix #68406
 [2018-02-14 16:29 UTC] pollita@php.net
Automatic comment on behalf of jhdxr
Revision: http://git.php.net/?p=php-src.git;a=commit;h=47a39882366604bb6f184987be9e56d3ee2810b9
Log: Fixed bug #68406 calling var_dump on a DateTimeZone object modifies it
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 09:01:32 2024 UTC