[Typo3-dev] Bug in class.gzip_encode

4Dfx peter.russ at 4dfx.de
Fri Sep 5 12:12:09 CEST 2003


Simon Child schrieb:
[...]

> It seems that if I enter the word true it will be processed as a string and
> not as Boolean?
> 
> So the comparison will fail.
> 
> Removing one of the = still seems sensible - what would be the harm?
> 
> --
> Simon Child
[...]

<?
	function test($var)
     {
     	if ($var===true) echo "Value of var is $var -> it's <b>Boolean</b> 
and <b>true</b><br>";
         else if ($var===false) echo "Value of var is $var -> it's 
<b>Boolean</b> and <b>false</b><br>";
         else if	($var==true) echo "Value of var is $var -> it seems to 
be <b>true</b><br>";
         else if	($var==false) echo "Value of var is $var -> it seems to 
be <b>false</b><br>";
         else echo "I've no idea what <b>$var</b> is<br>";
     }

     echo "Test <b>true</b>: "; test(true);
     echo "Test <b>false</b>: "; test(false);
     echo "Test <b>0</b>: "; test(0);
     echo "Test <b>1</b>: "; test(1);
     echo "Test <b>3</b>: "; test(3);
     echo "Test <b>\"true\"</b>: "; test("true");
?>
Test it on your system. And see what happens.

Regs. Peter.






More information about the TYPO3-dev mailing list