Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:16021 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 17544 invoked by uid 1010); 18 Apr 2005 19:29:02 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 17529 invoked from network); 18 Apr 2005 19:29:02 -0000 Received: from unknown (HELO gmail.com) (127.0.0.1) by localhost with SMTP; 18 Apr 2005 19:29:02 -0000 X-Host-Fingerprint: 64.233.170.195 rproxy.gmail.com Linux 2.4/2.6 Received: from ([64.233.170.195:53081] helo=rproxy.gmail.com) by pb1.pair.com (ecelerity 1.2.12rc1 r(5476:5477)) with SMTP id 74/16-18700-D7A04624 for ; Mon, 18 Apr 2005 15:29:01 -0400 Received: by rproxy.gmail.com with SMTP id b11so976760rne for ; Mon, 18 Apr 2005 12:28:58 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Ec53TiLOqm3LwNk3n48U9S+tPhIZyfAp/A336/cTHxYE/yczDbHeYRcsB5WLyEYu+WmT5kSBVZekP3zeFHDm8KP56fqLq3gab/Pmn4MIkI1yH9oD6PQ5z9kxCTlN56pbP3UqkL460STDF3dqXDE+yxs7gjx/qfgx2eMBcray9X8= Received: by 10.38.98.30 with SMTP id v30mr290400rnb; Mon, 18 Apr 2005 12:28:58 -0700 (PDT) Received: by 10.38.9.78 with HTTP; Mon, 18 Apr 2005 12:28:58 -0700 (PDT) Message-ID: <3c4c8fa605041812285af6e888@mail.gmail.com> Date: Tue, 19 Apr 2005 02:28:58 +0700 Reply-To: garbageman@gauldong.net To: Sara Golemon Cc: internals@lists.php.net In-Reply-To: <20050418185855.94161.qmail@lists.php.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <3c4c8fa60504181146526b0a84@mail.gmail.com> <20050418185855.94161.qmail@lists.php.net> Subject: Re: [PHP-DEV] Re: == and === From: gauldong@gmail.com (Hendy Irawan) On 4/19/05, Sara Golemon wrote: > > Just came across this: > > http://bugs.php.net/bug.php?id=3D23110 > > > > I've been programming PHP since PHP 3 > > and wasn't even aware of this behavior. > > > And now you are. >=20 > PHP is a loosely typed language. Odds are it's one of the things which > attracted you to it in the first place. I can understand 0 =3D=3D '' is true, but the string thingy is a bit surpri= sing me. I thought =3D=3D=3D is only used when comparing different types, so it's used to strictly compare things of the same type as well? (as the case, strings, but objects come to mind as well) I guess =3D=3D=3D is a strict equality operator more than it is a type equality operator. > > "Numeric strings"? What is that? > > > Roughly speaking, a string matching the pattern: > /^(-\d)?\d*(.[0-9]*)?(E[+-]\d+)?/ > Though that's not precisely how the engine handles it internally. >=20 > > if ($typedPassword =3D=3D $password) doSomeAdministrativeTaskHere(); > > > > You better not use '000000001' as password, or '0e00.0000', since > > people would be able to use '' (yes, empty string!) to hack your app. > > > Quick! Go change your password! 1 (nothing, false) 1 That confuses me more (but understandable, and thank God PHP behave this way)... I thought 'asdasd' is 0 when [implicitly] converted to int [for comparison]? I guess I never knew PHP well :-( --=20 Hendy Irawan http://www.gauldong.net http://dev.gauldong.net