PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Date and Time » Date » Bug #6246

inDaylightTime() crashes Apache 2.0.55 with status 3221225477

Details

Submitted2005-12-14 20:50 UTC
Fromariel at trisolutions dot com dot br
Assignedpajoye
StatusClosed
PackageDate
PHP Version5.1.1
OSWindows XP SP2
Roadmaps(Not assigned)

Comments

[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-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.