[thelist] PHP Header oddness

Jay Blanchard jay.blanchard at THERMON.com
Fri Oct 7 11:23:28 CDT 2005


[snip]
>        if($retval) {

> It may be, but in the statement above it ALWAYS evaluates to TRUE, you
must
> test for the value;
> 
> if(FALSE === $retval) 

Did PHP5 break the definition of a boolean evaluation and I didn't notice?
[/snip]

Since PHP is not strongly typed you may run into errors of this type,
dependent upon release. I conducted the following test to make sure that
bools are handled properly (PHP 4.4.n). If 

$retval = TRUE;
echo $retval . "<br>\n";
if($retval){
	echo "The variable is TRUE<br>\n";
} else {
	echo "The variable is FALSE<br>\n";
}   

In this case $retval is specifically given a boolean value. YMMV if $retval
is not set.


More information about the thelist mailing list