Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:59028 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 82333 invoked from network); 19 Mar 2012 06:49:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Mar 2012 06:49:42 -0000 Authentication-Results: pb1.pair.com smtp.mail=swhitemanlistens-software@cypressintegrated.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=swhitemanlistens-software@cypressintegrated.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain cypressintegrated.com designates 69.28.242.152 as permitted sender) X-PHP-List-Original-Sender: swhitemanlistens-software@cypressintegrated.com X-Host-Fingerprint: 69.28.242.152 rproxy1-a.cypressintegrated.com Received: from [69.28.242.152] ([69.28.242.152:4531] helo=rproxy1-a.cypressintegrated.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 38/21-08021-507D66F4 for ; Mon, 19 Mar 2012 01:49:42 -0500 Received: from bad.dop.co ([192.168.87.152]) by rproxy1-a.cypressintegrated.com (Brand New Heavy v1.0) with ASMTP id DJQ23440 for ; Mon, 19 Mar 2012 02:49:40 -0400 Date: Mon, 19 Mar 2012 02:50:15 -0400 Reply-To: Sanford Whiteman X-Priority: 3 (Normal) Message-ID: <166869720.20120319025015@cypressintegrated.com> To: Simon Schick In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Scalar-type-hinting - which way is the best to go? From: swhitemanlistens-software@cypressintegrated.com (Sanford Whiteman) > But I just wanted to point out that this is something the author > (and I) would never expect to happen ... > in_array("123abc", array(3, 7, 123, 28)) === true Well, would you never expect select ( '123abc' in (3,7,123,28) ) to return boolean true in SQL? Because it does. Me, I'm happy with the parity of these two languages that so often must work in tandem. YMMV but I don't see anything kooky. As Adam & others have pointed out, the author of that blog post used the original input as-is. Akin to passing a var into a sanitization function (by value), getting a return true, and continuing processing w/the initial var. I'm not saying I haven't done plenty of similarly stupid things, but I don't see them as evidence to be entered against, well, anything except my own incompetence. -- S.