Bug #68406 [NEW]: calling var_dump on a DateTimeZone object modifies it
| From: | derick@php.net | Date: | Tue, 11 Nov 2014 20:48:40 +0000 |
| Subject: | Bug #68406 [NEW]: calling var_dump on a DateTimeZone object modifies it | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-188560@lists.php.net to get a copy of this message | ||
From: derick@php.net
Operating system: *
PHP version: 5.6.2
Package: Date/time related
Bug Type: Bug
Bug description:calling var_dump on a DateTimeZone object modifies it
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 bug report at https://bugs.php.net/bug.php?id=68406&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=68406&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=68406&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=68406&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=68406&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=68406&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=68406&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=68406&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=68406&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=68406&r=support
Expected behavior: https://bugs.php.net/fix.php?id=68406&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=68406&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=68406&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=68406&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=68406&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=68406&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=68406&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=68406&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=68406&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=68406&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=68406&r=mysqlcfg