|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2001-08-09 08:18 UTC] joustin at plusnet dot pl
Hmm... why is that ?
Am I reading manual too briefly, or is there something with the operators ? might be bogus, but please enlighten me:P
btw: I thought that there's no seperate boolean type =]
<?
function foo(){
return true;
}
if(foo() == 'whatever you like'){
echo '!?!? why is that equal ?';
}
?>
<?
function paranoid(){
return 1;
}
if(!(paranoid() == (string) 'whatever you like')){
echo 'hmm??';
}
?>
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 07:00:01 2025 UTC |
Geez... THAT'll make some people quite confused/lost, when analysing the results from a function with if/elseif or switch. Consider: <? function foo(){ #... return true; #...or... return 'works ok'; } $foo = foo(); if(!$foo){ #whatever }elseif($foo == 'works ok'){ #this will hit }else{ #or else... } ?>