Re: PHP Editor - which to use?

From: Date: Wed, 24 Sep 2003 14:21:34 +0000
Subject: Re: PHP Editor - which to use?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-163746@lists.php.net to get a copy of this message
Jon Haworth wrote:
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 }
From the futher reading of the code we are able to deduct it can be also an integer:
    $back_url_params =
        substr( $HTTP_GET_VARS['origin'], $pos_params + 1 );
but then testing it this way: if($pos_params!==false) would be more appropriate in this case. For those interested this code snippet was taken from oscommerce. Marek

« previous php.general (#163746) next »