Very simple PHP code crashing Apache
I am using Wampserver on Windows XP and Apache 2.2.21.
This code will work when executed:
<?php
class Tax {
public static function load($id)
{
echo $id;
}
}
$tax = Tax::load(1);
?>
This code does NOT crash when executed:
<?php
class Tax {
public static function load($id)
{
echo $id;
}
}
$tax = Tax::load(10);
?>
Made easy, if I pass a single digit to the load function , Apache crashes. However, if I change the name of the function to anything other than load , it works fine. Also, I know the function doesn't return anything, but it still has to compile, at least.
This code also works:
Tax::load(5);
I am now at a loss as I do not know why this code will cause a crash. Help me please.
EDIT
I am using PHP 5.3.10
There are no errors in Apache error logs
Change the name of the $ tax variable to something else (e.g. $ a). I am even more confused.
I know Apache is crashing because I am getting Windows error. The Apache server restarts automatically and comes back up a minute after it crashes.
source to share