Solved;partially: PHP 5.2 -> 5.3 Windows Apache2.2 crash
Posted: Wed Mar 03, 2010 7:46 pm
Found this would only happen when encoded with Ioncube (though using their latest loaders).. to bug them about it.
Hi,
Recently moved from 5.2 to 5.3.
Now Apache will crash on loading pretty much all my pages with this in the error report;
szAppName : httpd.exe szAppVer : 2.2.14.0 szModName : php5ts.dll
szModVer : 5.3.1.0 offset : 0000c266
Eventually found out how it happens.
If I pass to a function an undefined variable as per example;
function testing($var1,$var2){
return 1;
}
echo testing($undefined1,$undefined2);
It will crash. No error in Apache log, no error in PHP log.
If I define $undefined2 before calling testing() then it won't crash.
Whether I define $undefined1 or not (strangely, if not strange enough already) doesn't make any difference, only causes a crash on the second or higher variable in the function definition.
Whether or not I specify $var2 = null or any other value in the function definition; it will still crash if $undefined2 is not previously defined.
Looking at the changes between 5.2 and 5.3 ; I assume this problem has spawned from this reported change
"The newer internal parameter parsing API has been applied across all the extensions bundled with PHP 5.3.x. This parameter parsing API causes functions to return NULL when passed incompatible parameters. There are some exceptions to this rule, such as the get_class() function, which will continue to return FALSE on error"
Now; I'm sure you may say, well that's just bad coding practice, you should always define your variables before calling them. Perhaps that may be true; but from the many years that I have constructed my system , I have depended on this behaviour and it suits me well. If I am to change the way I code; then it will take a little while for me to fix this issue.
So I guess I am just asking at this stage if anyone can confirm the issue at hand; then I suppose I will submit a PHP bug report and hope something can be done.
Appreciate any help,
Jett
Hi,
Recently moved from 5.2 to 5.3.
Now Apache will crash on loading pretty much all my pages with this in the error report;
szAppName : httpd.exe szAppVer : 2.2.14.0 szModName : php5ts.dll
szModVer : 5.3.1.0 offset : 0000c266
Eventually found out how it happens.
If I pass to a function an undefined variable as per example;
function testing($var1,$var2){
return 1;
}
echo testing($undefined1,$undefined2);
It will crash. No error in Apache log, no error in PHP log.
If I define $undefined2 before calling testing() then it won't crash.
Whether I define $undefined1 or not (strangely, if not strange enough already) doesn't make any difference, only causes a crash on the second or higher variable in the function definition.
Whether or not I specify $var2 = null or any other value in the function definition; it will still crash if $undefined2 is not previously defined.
Looking at the changes between 5.2 and 5.3 ; I assume this problem has spawned from this reported change
"The newer internal parameter parsing API has been applied across all the extensions bundled with PHP 5.3.x. This parameter parsing API causes functions to return NULL when passed incompatible parameters. There are some exceptions to this rule, such as the get_class() function, which will continue to return FALSE on error"
Now; I'm sure you may say, well that's just bad coding practice, you should always define your variables before calling them. Perhaps that may be true; but from the many years that I have constructed my system , I have depended on this behaviour and it suits me well. If I am to change the way I code; then it will take a little while for me to fix this issue.
So I guess I am just asking at this stage if anyone can confirm the issue at hand; then I suppose I will submit a PHP bug report and hope something can be done.
Appreciate any help,
Jett