|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44742 timezone_offset_get() behaviour change
Submitted: 2008-04-16 11:24 UTC Modified: 2008-04-26 11:26 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: Assigned: derick (profile)
Status: Closed Package: Date/time related
PHP Version: 5.2CVS-2008-04-24 (snap) OS: Any
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
New email:
PHP Version: OS:


 [2008-04-16 11:24 UTC]
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:

Actual result:
Segmentation fault


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-04-16 11:51 UTC]
Works fine with 5.2.5...
 [2008-04-16 17:24 UTC]
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
Thank you for the report, and for helping us make PHP better.

However, the expected output is int(0).
 [2008-04-24 16:05 UTC]
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));'

$ 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));'

$ ./php.exe -v
PHP 5.2.6RC6-dev (cli) (built: Apr 24 2008 08:04:56) 

 [2008-04-24 16:08 UTC]
You did notice Derick's comment?

"However, the expected output is int(0)."

So what you get is the expected value..
 [2008-04-26 11:26 UTC]
> "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.

PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Sep 27 02:03:36 2021 UTC