Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:46701 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 2639 invoked from network); 13 Jan 2010 16:53:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Jan 2010 16:53:32 -0000 Authentication-Results: pb1.pair.com header.from=rquadling@googlemail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=rquadling@googlemail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain googlemail.com designates 209.85.220.227 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: rquadling@googlemail.com X-Host-Fingerprint: 209.85.220.227 mail-fx0-f227.google.com Received: from [209.85.220.227] ([209.85.220.227:62183] helo=mail-fx0-f227.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7D/1A-00773-A8AFD4B4 for ; Wed, 13 Jan 2010 11:53:31 -0500 Received: by fxm27 with SMTP id 27so740655fxm.23 for ; Wed, 13 Jan 2010 08:53:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:in-reply-to :references:from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=FqLxVELKfbRd9TaKHsIOFzpVEYOiyv9PCSrH58j5LpI=; b=LqFt32Qh+oMGMLVgsl93J5RhsDRIw0uaYTmG6WL6W7W+DybPuuTNA0x5oKx8a0n97u vMD65aE1kJB7AnQqWJ5IMbFpLQre1j3LEmF2ydQIRIPxRfjmTqJIsaTokTFLzbGfFPX3 SPEIYvqEuz/0Ez9F/w9yDbykrIkzyg8D0VTGM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to:cc:content-type:content-transfer-encoding; b=JiQ5CGE3CLZDtDInii+4NErUIa+NwUF0193UJpJC8a+qEuUXL4yTHwr7iqygW07jsQ 60SDVNwCARhzsDBIRTEKvhZII2JWyvCw6DMrVNseSBZhORCHaMl5LzVd3WqVgk61zKOw bvCVPdhgxHX2IH4T4h94WEU0WvuyyOOmIg08o= MIME-Version: 1.0 Received: by 10.223.14.22 with SMTP id e22mr10978380faa.42.1263401607214; Wed, 13 Jan 2010 08:53:27 -0800 (PST) Reply-To: RQuadling@googlemail.com In-Reply-To: <4B4DF982.3020308@lerdorf.com> References: <10845a341001130802l49d7df07g7ecf846d9867193b@mail.gmail.com> <4B4DF982.3020308@lerdorf.com> Date: Wed, 13 Jan 2010 16:53:07 +0000 Message-ID: <10845a341001130853h1ad7a105r1e5c805b90d1ac6d@mail.gmail.com> To: Rasmus Lerdorf Cc: PHP internals Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Numerical string comparison - octal and hex. From: rquadling@googlemail.com (Richard Quadling) 2010/1/13 Rasmus Lerdorf : > Richard Quadling wrote: >> Hello. >> >> In looking at numer vs string comparison, I think I've found an oddity. >> >> You can successfully compare hex strings ... >> >> var_dump(255 =3D=3D '0xff'); >> >> but not octal strings ... >> >> var_dump(63 =3D=3D '077'); >> >> >> Is this a bug (lack of octal support) or an unexpected feature (hex supp= ort)? > > We don't have octal strings in PHP. =C2=A0Only native octal. > eg. > var_dump(63 =3D=3D 077); > > Why? =C2=A0Mostly because octal strings is more likely to cause incorrect > behaviour than both regular numeric strings and hex strings. > > -Rasmus > Thank you. Should [1] be updated to include hex strings and a note about octal strings= ? Richard. [1] http://docs.php.net/manual/en/language.types.string.php#language.types.= string.conversion --=20 ----- Richard Quadling "Standing on the shoulders of some very clever giants!" EE : http://www.experts-exchange.com/M_248814.html Zend Certified Engineer : http://zend.com/zce.php?c=3DZEND002498&r=3D213474= 731 ZOPA : http://uk.zopa.com/member/RQuadling