Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:44901 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 1683 invoked from network); 10 Jul 2009 11:40:54 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Jul 2009 11:40:54 -0000 Authentication-Results: pb1.pair.com smtp.mail=mls@pooteeweet.org; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=mls@pooteeweet.org; sender-id=unknown Received-SPF: error (pb1.pair.com: domain pooteeweet.org from 88.198.8.16 cause and error) X-PHP-List-Original-Sender: mls@pooteeweet.org X-Host-Fingerprint: 88.198.8.16 bigtime.backendmedia.com Linux 2.6 Received: from [88.198.8.16] ([88.198.8.16:41903] helo=bigtime.backendmedia.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8E/16-23850-4C8275A4 for ; Fri, 10 Jul 2009 07:40:53 -0400 Received: from localhost (unknown [127.0.0.1]) by bigtime.backendmedia.com (Postfix) with ESMTP id A1982414405B; Fri, 10 Jul 2009 11:42:15 +0000 (UTC) X-Virus-Scanned: amavisd-new at backendmedia.com Received: from bigtime.backendmedia.com ([127.0.0.1]) by localhost (bigtime.backendmedia.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id znBK9AItEffk; Fri, 10 Jul 2009 13:42:14 +0200 (CEST) Received: from [10.11.10.142] (unknown [194.209.131.192]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: mls@pooteeweet.org) by bigtime.backendmedia.com (Postfix) with ESMTP id 5DCC24144058; Fri, 10 Jul 2009 13:42:13 +0200 (CEST) Cc: Alain Williams , "Ionut G. Stan" , internals@lists.php.net Message-ID: To: Lewis Wright 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: Fri, 10 Jul 2009 13:40:47 +0200 References: <7.0.1.0.2.20090708224156.0ac5a438@zend.com> <312025EF-84D0-4411-A0A7-4F0379C3105F@pooteeweet.org> <22CAD497EA2F476DAECEF9302D0B087A@pc> <98b8086f0907091150r47e7a103jaa50fcf7d5b32186@mail.gmail.com> <4A568B33.9000501@gmail.com> <98b8086f0907091744w7ab598dckc427d0a9484664b2@mail.gmail.com> <20090710102302.GC20283@gerbil.thgnet.it> <4A571981.80900@gmail.com> <20090710110522.GD19636@mint.phcomp.co.uk> X-Mailer: Apple Mail (2.935.3) Subject: Re: [PHP-DEV] Type hinting - Request for Discussion From: mls@pooteeweet.org (Lukas Kahwe Smith) On 10.07.2009, at 13:20, Lewis Wright wrote: >> 3) function Foo(is_int($x)) { >> >> Function is_int is called, an error is raised if it returns false. >> > > But then you're complicating it to the point where it's no longer > much more > useful than just calling the is_numeric method in the function body. > Plus > there's no longer the advantage of optimisers knowing the data-type. right .. lets not forget the original goal (though it hasnt been perfectly defined) the idea was to move common validation code out of the function body to reduce code, increase readability and enable IDE's to be even smarter. moving the function body into the signature was not the plan, as it will kill the above features for the sake of flexibility. the point is not flexibility, its finding a sensible common denominator for validation of input parameters and optimizing the syntax for that case. regards, Lukas Kahwe Smith mls@pooteeweet.org