Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:44641 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 25349 invoked from network); 2 Jul 2009 12:43:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Jul 2009 12:43:50 -0000 Authentication-Results: pb1.pair.com smtp.mail=ilia@ilia.ws; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ilia@ilia.ws; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ilia.ws designates 209.85.198.236 as permitted sender) X-PHP-List-Original-Sender: ilia@ilia.ws X-Host-Fingerprint: 209.85.198.236 rv-out-0506.google.com Received: from [209.85.198.236] ([209.85.198.236:14161] helo=rv-out-0506.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B9/D1-16153-68BAC4A4 for ; Thu, 02 Jul 2009 08:43:50 -0400 Received: by rv-out-0506.google.com with SMTP id l9so576194rvb.23 for ; Thu, 02 Jul 2009 05:43:47 -0700 (PDT) Received: by 10.140.255.19 with SMTP id c19mr7060rvi.157.1246538627688; Thu, 02 Jul 2009 05:43:47 -0700 (PDT) Received: from ?192.168.1.169? (TOROON63-1176059019.sdsl.bell.ca [70.25.60.139]) by mx.google.com with ESMTPS id f21sm10740703rvb.36.2009.07.02.05.43.46 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 02 Jul 2009 05:43:47 -0700 (PDT) Cc: PHP Internals , Derick Rethans , Stanislav Malyshev , Hannes Magnusson Message-ID: <85073B28-671D-4A8F-B2D6-5704E3E180BB@ilia.ws> To: Paul Biggar In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Date: Thu, 2 Jul 2009 08:43:43 -0400 References: X-Mailer: Apple Mail (2.935.3) Subject: Re: Flexible type hinting From: ilia@ilia.ws (Ilia Alshanetsky) On 2-Jul-09, at 4:45 AM, Paul Biggar wrote: > On Thu, Jul 2, 2009 at 5:26 AM, Ilia Alshanetsky wrote: > >> 1) Strict type hinting helps to solve bugs, both the ones made out of >> careless/missing validation as well as subtle logic bugs that often >> take >> hours to resolve. I can tell you that within a week of implementing >> type >> hints we've been able to identify 30-40 bugs within a period of >> day. Many of >> which would not have been detected with "flexible" type hints that >> Paul is >> suggesting here is one example: > > I think you might not have read what I suggested (it is different than > the one I emailed to you privately). What you want is fully supported. > If you must be passed an int, use the +int hint. I'd rather use -int, then +int and make people who want loose typing do the extra bit, because native typing should be strict.