note 13527 rejected and deleted from function.strpos.php by zak
| From: | zak@php.net | Date: | Thu, 21 Jun 2001 01:31:56 +0000 |
| Subject: | note 13527 rejected and deleted from function.strpos.php by zak | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-14506@lists.php.net to get a copy of this message | ||
Note the following:
The === or !== operators do have a higher precedence than == or != operators. This can harm you in
the case, that if you write sth like
if ( $pos=strpos($hugo,'/') !== false )
...
This dosn't work, PHP evals this like in the following order:
if ( $pos= ( strpos($hugo,'/') !== false ) )
...
which means, that $pos is at the end either true or false (which is not what you in most cases
wanted - I think :-). So the correct writing for this is
if ( ( $pos=strpos($hugo,'/') ) !== false )
...