Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:37348 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 6017 invoked from network); 30 Apr 2008 11:53:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Apr 2008 11:53:53 -0000 Authentication-Results: pb1.pair.com smtp.mail=sam@sambarrow.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=sam@sambarrow.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain sambarrow.com from 208.70.128.56 cause and error) X-PHP-List-Original-Sender: sam@sambarrow.com X-Host-Fingerprint: 208.70.128.56 smtp-gw30.mailanyone.net Received: from [208.70.128.56] ([208.70.128.56:52878] helo=smtp-gw30.mailanyone.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4E/85-05418-0DD58184 for ; Wed, 30 Apr 2008 07:53:52 -0400 Received: from mailanyone.net by smtp-gw30.mailanyone.net with esmtpsa (TLSv1:RC4-MD5:128) (MailAnyone extSMTP sam@sambarrow.com) id 1JrAsg-0004U1-7F; Wed, 30 Apr 2008 06:53:50 -0500 To: Arvids Godjuks Cc: Jessie Hernandez , Nathan Nobbe , David =?ISO-8859-1?Q?Z=FClke?= , Alain Williams , internals@lists.php.net In-Reply-To: <9b3df6a50804292323v615ede7xb5143e93dd430c49@mail.gmail.com> References: <1209137410.6642.9.camel@sbarrow-desktop> <1209150944.20639.24.camel@sbarrow-desktop> <7dd2dc0b0804251224s750679acn169637efbd8653fa@mail.gmail.com> <1209151505.20639.25.camel@sbarrow-desktop> <20080425231305.GC14490@mint.phcomp.co.uk> <9484717D-2EC6-44FF-93C8-1A9911294AF6@bitxtender.com> <7dd2dc0b0804261524l22237b58tfb9d0a341ab77233@mail.gmail.com> <1209482524.3257.9.camel@sbarrow-desktop> <4817D5E6.3010606@gmail.com> <9b3df6a50804292323v615ede7xb5143e93dd430c49@mail.gmail.com> Content-Type: text/plain Date: Wed, 30 Apr 2008 07:50:15 -0400 Message-ID: <1209556215.24655.4.camel@sbarrow-desktop> Mime-Version: 1.0 X-Mailer: Evolution 2.10.1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Return type hinting patch From: sam@sambarrow.com (Sam Barrow) On Wed, 2008-04-30 at 09:23 +0300, Arvids Godjuks wrote: > I'm +1 for this syntax > > function int myfunction(int $param) > { > return $someint; > } > > C/C++ like, easy to understand > > > And bad idea about making a return type "function" - looks very > useless and will not be used a lot. Work with objects with methods > returning an object of some kind, then you can do Function is a reserved keyword in PHP anyway, it would cause problems in numerous places if it was used as a type. > $object->method()->method2()->method3(); > > P.S. I think this thread should be merged with function param type > hinting because they come together and should be implemented together, Well this is two parts, class/array hinting and scalar hinting. Class and array hinting is already implemented, so for now I'm just pushing for that in return types.