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.

+3


source to share


3 answers


If Apache does crash, you should look at the following file to see what happened:



[WAMP directory]/apache/logs/error.log

      

+6


source


Try to change the name of $ tax (variable).



0


source


just because it echoes and doesn't return shouldn't crash apache.

0


source







All Articles