Bug #68406 [Opn->Csd]: calling var_dump on a DateTimeZone object modifies it

From: Date: Mon, 12 Feb 2018 08:20:51 +0000
Subject: Bug #68406 [Opn->Csd]: calling var_dump on a DateTimeZone object modifies it
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-213926@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=68406&edit=1

 ID:                 68406
 Updated by:         krakjoe@php.net
 Reported by:        derick@php.net
 Summary:            calling var_dump on a DateTimeZone object modifies
                     it
-Status:             Open
+Status:             Closed
 Type:               Bug
 Package:            Date/time related
 Operating System:   *
 PHP Version:        5.6.2
 Block user comment: N
 Private report:     N

 New Comment:

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


Previous Comments:
------------------------------------------------------------------------
[2014-11-11 20:48:40] 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


------------------------------------------------------------------------



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


Thread (2 messages)

« previous php.bugs (#213926) next »