Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:37056 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 69194 invoked from network); 17 Apr 2008 11:48:58 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Apr 2008 11:48:58 -0000 Authentication-Results: pb1.pair.com smtp.mail=cschneid@cschneid.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=cschneid@cschneid.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain cschneid.com from 195.141.85.117 cause and error) X-PHP-List-Original-Sender: cschneid@cschneid.com X-Host-Fingerprint: 195.141.85.117 uf1.search.ch Linux 2.6 Received: from [195.141.85.117] ([195.141.85.117:53489] helo=smtp.rim.ch) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D4/36-38326-72937084 for ; Thu, 17 Apr 2008 07:48:56 -0400 Received: from localhost (localhost [127.0.0.1]) by rolig.search.ch (Postfix) with ESMTP id D38093F5E1F; Thu, 17 Apr 2008 13:48:52 +0200 (CEST) Received: from smtp.rim.ch ([127.0.0.1]) by localhost (search.ch [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 07076-10; Thu, 17 Apr 2008 13:48:50 +0200 (CEST) Received: from [192.168.1.72] (ultrafilter-i [192.168.85.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by rolig.search.ch (Postfix) with ESMTP id 8AB513F5D87; Thu, 17 Apr 2008 13:48:50 +0200 (CEST) Message-ID: <48073922.6030808@cschneid.com> Date: Thu, 17 Apr 2008 13:48:50 +0200 User-Agent: Thunderbird 1.5.0.12 (X11/20060911) MIME-Version: 1.0 To: Felipe Pena CC: internals@lists.php.net References: <1208404255.5665.34.camel@pena> In-Reply-To: <1208404255.5665.34.camel@pena> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: amavisd-new at search.ch Subject: Re: [RFC] Type hints (parameter and return value) From: cschneid@cschneid.com (Christian Schneider) Felipe Pena wrote: > For parameter type hints, i have completed the actual implementation > with the leftover php types: > - string (binary string and unicode) > - integer (accepting numeric string too) > - double (accepting numeric string too) > - boolean ('0', '1', true, false) > - resource > - object I don't like the difference between function (int) test($value) { ... } and function test(integer $value) { ... } I don't think we should introduce two different names for something which is basically the same. Even if there is (as I guess) a slight difference (int *really* being int and integer allowing strings containing numbers), which makes the WTF factor even higher IMHO. Also about "New tokens (new keywords)": I haven't tried the patch so excuse me asking. Does this mean $this->string is invalid because string is a new keyword? Then I'd be strongly against having these new keywords. Is there any performance impact for people not using type hints? Just to make it clear: I think type hinting is a Bad Idea(tm) anyway but *if* it is implemented I think you should consider the above points. - Chris