Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.5.0a4

Bug #6246 inDaylightTime() crashes Apache 2.0.55 with status 3221225477
Submitted: 2005-12-14 20:50 UTC
From: ariel at trisolutions dot com dot br Assigned: pajoye
Status: Closed Package: Date
PHP Version: 5.1.1 OS: Windows XP SP2
Roadmaps: (Not assigned)    

 [2005-12-14 20:50 UTC] ariel at trisolutions dot com dot br
Description: ------------ Using Date 1.4.6. Calling Date_TimeZone::inDaylightTime() crashes Apache 2.0.55 with the following message: [notice] Parent: child process exited with status 3221225477 -- Restarting. The following code reproduces the error: <? require "Date.php"; $date = new Date; echo $date->getDate(); echo "<BR>"; echo "Is in daylight saving time? ". $date->inDaylightTime($date)."<BR>"; ?> Replacing inDaylightTime() by this simple piece of code: function inDaylightTime($date) { return date("I"); } fixes that bug. I ask myself what's the reason for messing up with putenv() and getenv()?


 [2005-12-14 20:58 UTC] ariel at trisolutions dot com dot br
Note that with the replaced version of the code, there's no need to pass any argument to inDaylightTime() and this function can be called statically: function inDaylightTime() { return date("I"); } Of course, you cannot test if a given date is in daylight time, only the current date. But anyway, I think this is the purpose of this function.
 [2005-12-14 21:31 UTC] pajoye
The solution is not valid. You misunderstood the purpose of the function, it exists to be used with a given date. A fix is coming but will break backward compatibility for php5+
 [2005-12-16 16:09 UTC] ariel at trisolutions dot com dot br
If that is the case, why don't use: function inDaylightTime($date) { return date( 'I', $date->getDate(DATE_FORMAT_UNIXTIME) ); } That serves the purpose of the function. Anyway, hope the fix to come.
 [2006-12-08 09:18 UTC] firman (Firman Wandayandi)
Thank you for your bug report. This issue has been fixed in the latest released version of the package, which you can download at This bug already fixed in release 1.4.7, try to run a test script below for test it: Thanks