Re: = 0 and = "0"

From: Date: Fri, 26 Oct 2001 14:06:45 +0000
Subject: Re: = 0 and = "0"
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-72494@lists.php.net to get a copy of this message
On Thu, 25 Oct 2001 02:04:14 -0700 (PDT) impersonator of rasmus@php.net (Rasmus Lerdorf) planted &I saw in php.general: > if(strpos("abcdef","abc")) { ... } > >and then be confused that the condition appeared not to be met. What they >actually should have done was: > > if(strpos("abcdef","abc")!==false) { ... } > Or better yet, i think: if(is_int(strpos(..))){..} coz this way it should not depend on php version (whereus === and !== do depend), i think:)

« previous php.general (#72494) next »