Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:21230 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 9472 invoked by uid 1010); 15 Dec 2005 14:33:48 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 9457 invoked from network); 15 Dec 2005 14:33:48 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Dec 2005 14:33:48 -0000 X-Host-Fingerprint: 69.64.38.41 bluga.net Linux 2.5 (sometimes 2.4) (4) Received: from ([69.64.38.41:41132] helo=bluga.net) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id F7/BD-23096-CCE71A34 for ; Thu, 15 Dec 2005 09:33:48 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by bluga.net (Postfix) with ESMTP id D3DBE5387BE; Thu, 15 Dec 2005 08:35:37 -0600 (CST) Received: from bluga.net ([127.0.0.1]) by localhost (bluga.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 06291-02; Thu, 15 Dec 2005 08:35:37 -0600 (CST) Received: from [192.168.1.44] (pool-71-247-25-164.nycmny.east.verizon.net [71.247.25.164]) by bluga.net (Postfix) with ESMTP id 7D5A05387AD; Thu, 15 Dec 2005 08:35:37 -0600 (CST) Message-ID: <43A17EC3.6080606@php.net> Date: Thu, 15 Dec 2005 09:33:39 -0500 User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Stefan Walk CC: php-dev References: <43A0F0BB.6080009@chiaraquartet.net> <4858f9d90512150059x71eec489t@mail.gmail.com> In-Reply-To: <4858f9d90512150059x71eec489t@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new using ClamAV at bluga.net Subject: Re: [PHP-DEV] why is '01' == '1.'? From: cellog@php.net (Greg Beaver) Stefan Walk wrote: > See http://bugs.php.net/bug.php?id=23110 > > It's definitely a gotcha, especially if you use switch(){}, as there > is no way to do strict type checking there. Please reconsider the decision to leave this bug open in PHP, any unexpected behavior in an operator as fundamental as == is VERY dangerous, and if used improperly could lead to security holes (i.e. unexpectedly, input that does not match could match a strict filter based on ==) I understand the rationale behind loosely typed comparison, and use it myself, but this is beyond loosely typed, it is explicitly changing type in an irrational way, as it only applies in certain cases. Greg