Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:44627 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 82727 invoked from network); 2 Jul 2009 08:46:06 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Jul 2009 08:46:06 -0000 Authentication-Results: pb1.pair.com header.from=paul.biggar@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=paul.biggar@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.219.227 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: paul.biggar@gmail.com X-Host-Fingerprint: 209.85.219.227 mail-ew0-f227.google.com Received: from [209.85.219.227] ([209.85.219.227:45456] helo=mail-ew0-f227.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B2/73-65216-DC37C4A4 for ; Thu, 02 Jul 2009 04:46:06 -0400 Received: by ewy27 with SMTP id 27so1674898ewy.23 for ; Thu, 02 Jul 2009 01:46:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=qOATRM9qnlT2bhwRqrNMVDm4oHGvPU2od3vbUhOs+2g=; b=kc6l+nQUyRuhdRbbs/Fr4muBPrZ4fga89P29QthVRT6c0RITG6FVnMmn/mX3+J1iGO hez1vwWMB5/Hou2bo2orD8N6ESwOGmw+UyJOof51l6m8Ejm9h+J2/OWcOzy0g7C0c4iS xoqGmJ1sh1uVba6Nf+eGkKWroFiXN8aNlpTFM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=UVRCwX33kLqUD+nidUH0Wk+Bj731WBWWZ40j4wCvaX3oXdL5ecaE0KGTfmMtsNN+29 v/AHchyEdxsNVBQ53/PU1MCwwEJ5ipvqfESweiay7nwIGVfr+l+wU1Y752L9eb6sSLV+ Cl2p4jaLFDcNuofRKhlXu2boQdnfoQId2GVI4= MIME-Version: 1.0 Received: by 10.210.65.16 with SMTP id n16mr584934eba.78.1246524363089; Thu, 02 Jul 2009 01:46:03 -0700 (PDT) In-Reply-To: References: Date: Thu, 2 Jul 2009 09:45:43 +0100 Message-ID: To: Ilia Alshanetsky Cc: PHP Internals , Derick Rethans , Stanislav Malyshev , Hannes Magnusson Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: Flexible type hinting From: paul.biggar@gmail.com (Paul Biggar) 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. > type. The code also includes bits from PEAR and external libs like fpdf and > guess what those have no type hints and they work along side with type > hinted code without any issues. It is instructive that PEAR could not use your proposed hints. The "flexible" system would work fine though. > situations. Of all the replies I see no objection so far and the only > complaint (funnily enough) is about existence of IS_NUMERIC. Yes. Nobody wants numeric. It doesnt hint at anything. > I do not wish to start a flame war or arrive at a wishy washy compromise > that does not provide a solid solution. If the majority disagrees with the I think my "flexible" system is not a wishy washy compromise (the one I sent you by private email was). I think rather it has all the advantages you want, all the advantages I want, and even supports what Stas wants. > to work in a future with a library/framework that is strict about its input > or some far fetched idea that it will change the very nature of PHP. I don't think we are worried about it changing PHP, or about libraries using strict type hints. We are worried that libraries will use no hints, because the ones on offer are not useful to them. Please, take a read over my full proposal. I think you'll find it that it supports everyone's features without compromise. Thanks, Paul -- Paul Biggar paul.biggar@gmail.com