php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #52142
Patch bug52142-fix_interval.c.patch revision 2010-08-15 21:18 UTC by strager dot nds at gmail dot com
Patch bug52142.phpt revision 2010-08-15 21:18 UTC by strager dot nds at gmail dot com

Patch bug52142.phpt for Date/time related Bug #52142

Patch version 2010-08-15 21:18 UTC

Return to Bug #52142 | Download this patch
Patch Revisions:

Developer: strager.nds@gmail.com

--- /dev/null	2010-08-15 03:20:48.005914231 -0400
+++ ext/date/tests/bug52142.phpt	2010-08-15 17:12:10.243594341 -0400
@@ -0,0 +1,19 @@
+--TEST--
+Bug #52142 (using diff change the datetime object)
+--FILE--
+<?php
+
+date_default_timezone_set( "Europe/Rome" );
+
+$da = new DateTime('2010-06-22T00:00:00+02:00');
+$a = new DateTime('2010/06/23');
+$da_copy = clone $da;
+
+echo "BEFORE " . $da->getTimezone()->getOffset($da) . "\n";
+
+$da->diff($a);
+
+echo "AFTER " . $da->getTimezone()->getOffset($da) . "\n";
+--EXPECT--
+BEFORE 7200
+AFTER 7200
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 08:01:33 2024 UTC