* Thus wrote Jon Haworth ([EMAIL PROTECTED]):
> Hi,
>
> > Good coder will understand this at a glimpse:
>
> [snip horrible code]
>
> > if($pos_params!=false)
um... you rewrote that, his code was:
if( $pos_params != false )
>
> Assuming it's a boolean, $pos_params is *already* true or false, so testing
> it like this is pretty much pointless. It makes more sense (and is much more
> readable IMHO) to do something like this:
>
> if ($pos_params) {
> // something
> }
Also, i'd like to add, that even though these code examples will
work it maybe a little missleading. Assuming where this $pos_params
came from is strpos(), $pos_params can be false or 0. The
condition that is being tested doesn't really let the code reader
know that.
In fact, there is a bug with both versions, if the $pos_params is
the first character (value of 0) then we the back_url_params is
going to get lost.
So in theory the condition *should* be
if ( $pos_params !== false)
Ok, I've evaluated all this code way too much now :)
Curt
--
"I used to think I was indecisive, but now I'm not so sure."
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php