#44742 [Fbk->Csd]: timezone_offset_get() behaviour change

From: Date: Sat, 26 Apr 2008 11:26:24 +0000
Subject: #44742 [Fbk->Csd]: timezone_offset_get() behaviour change
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-124531@lists.php.net to get a copy of this message
ID: 44742 Updated by: thekid@php.net Reported By: thekid@php.net -Status: Feedback +Status: Closed Bug Type: Date/time related Operating System: Any PHP Version: 5.2CVS-2008-04-24 (snap) Assigned To: derick New Comment: > "However, the expected output is int(0)." I indeed didn't notice this. The expected value was what PHP 5.2.5 gave me (and also what 5.2.0, 5.2.1 and 5.2.3 report). To sum it up: * PHP < 5.2.6 is broken * PHP 5.2.6RC* segfaulted and was thus broken * PHP >= 5.2CVS-2008-04-24 is fixed. Right? Previous Comments: ------------------------------------------------------------------------ [2008-04-24 16:08:00] jani@php.net You did notice Derick's comment? "However, the expected output is int(0)." So what you get is the expected value.. ------------------------------------------------------------------------ [2008-04-24 16:05:20] thekid@php.net Reopen, now I get different results: $ php -r '$date= date_create("2008-04-11 00:00:00+0000"); var_dump(timezone_offset_get(date_timezone_get($date), $date));' int(7200) $ php -v PHP 5.2.5 (cli) (built: Nov 8 2007 23:18:51) == versus == $ ./php.exe -r '$date= date_create("2008-04-11 00:00:00+0000"); var_dump(timezone_offset_get(date_timezone_get($date), $date));' int(0) $ ./php.exe -v PHP 5.2.6RC6-dev (cli) (built: Apr 24 2008 08:04:56) ------------------------------------------------------------------------ [2008-04-16 17:24:20] derick@php.net This bug has been fixed in CVS. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. However, the expected output is int(0). ------------------------------------------------------------------------ [2008-04-16 11:51:08] thekid@php.net Works fine with 5.2.5... ------------------------------------------------------------------------ [2008-04-16 11:24:45] thekid@php.net Description: ------------ timezone_offset_get() causes segmentation faults. Reproduce code: --------------- $ ./php.exe -r '$date= date_create("2008-04-11 00:00:00+0000"); var_dump(timezone_offset_get(date_timezone_get($date), $date));' [...Segmentation fault Dialog box...] friebe@rnt15501 ~/bin/php5dev $ ./php.exe -v PHP 5.2.6RC6-dev (cli) (built: Apr 15 2008 12:04:52) Copyright (c) 1997-2008 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies Expected result: ---------------- int(7200) Actual result: -------------- Segmentation fault ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=44742&edit=1

« previous php.bugs (#124531) next »