Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:57060 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 85816 invoked from network); 23 Dec 2011 20:34:06 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Dec 2011 20:34:06 -0000 Authentication-Results: pb1.pair.com header.from=will.fitch@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=will.fitch@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.170 as permitted sender) X-PHP-List-Original-Sender: will.fitch@gmail.com X-Host-Fingerprint: 209.85.215.170 mail-ey0-f170.google.com Received: from [209.85.215.170] ([209.85.215.170:58379] helo=mail-ey0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 25/70-16446-DB5E4FE4 for ; Fri, 23 Dec 2011 15:34:05 -0500 Received: by eaai11 with SMTP id i11so8882996eaa.29 for ; Fri, 23 Dec 2011 12:34:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=references:from:in-reply-to:mime-version:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=ZZHeB7j8wYn248cqm65VJdn3sCDLWlqqiXhD1490Gws=; b=okBM2jQiVZUJ32cqPCb/5cSF8HcEZx5Ln3Fuisd56CfHZGmrha6MZ38Q2kfZnfJXsP AoV1HwlSZXYyPkFihSnU2OjaMjChs4AIPeGqlZt0te9GfiyDkDMQVq+CwgPZoWIPGVPe /LSwBezoYvPaLXfV8+O19ac882FgZ9zZmXImw= Received: by 10.205.127.12 with SMTP id gy12mr4687563bkc.108.1324672441337; Fri, 23 Dec 2011 12:34:01 -0800 (PST) References: <2095305E-D4E3-4D7E-8218-32EE99688E0C@GMAIL.COM> <2C90FB94-38C4-4270-8C6A-B89304BA8ED8@gmail.com> <159A7CA2-8561-40DA-9434-CAAE12304DDB@gmail.com> <4EF3B56A.4040809@gmail.com> <-2451498990672032588@unknownmsgid> <4EF3C99F.4010300@gmail.com> <4EF3CEFA.4000301@alliantinternet.com> <008801ccc179$74ef1190$5ecd34b0$@alliantinternet.com> <9570D903A3BECE4092E924C2985CE48539A1826E@MBX202.domain.local> In-Reply-To: <9570D903A3BECE4092E924C2985CE48539A1826E@MBX202.domain.local> Mime-Version: 1.0 (1.0) Date: Fri, 23 Dec 2011 15:34:00 -0500 Message-ID: <-253406703910979221@unknownmsgid> To: Clint M Priest Cc: Dmitri Snytkine , =?UTF-8?B?w4FuZ2VsIEdvbnrDoWxleg==?= , PHP Developers Mailing List Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Return Type Hinting for Methods RFC From: will.fitch@gmail.com (Will Fitch) Im personally not a fan of declaring multiple return values. This defeats the purpose of being more strict. If your method may return different values outside of the declared type, then using the standard "function" keyword would signify mixed. There's still the matter of whether allowing null to be returned, regardless of the situation, or using another token to identify that it could return null. I'd like to know what others think. I see Stas' argument that you'll still have to check, but I'm not so sure that is such a bad thing. Sent from my iPad On Dec 23, 2011, at 3:07 PM, Clint M Priest wrote: > That syntax is pretty readable, would there be alternatives such as: > > function foo() returns Class3, array or null { > } > > -----Original Message----- > From: Dmitri Snytkine [mailto:dsnytkine@Ultralogistics.com] > Sent: Friday, December 23, 2011 7:48 AM > To: '=C3=81ngel Gonz=C3=A1lez'; 'PHP Developers Mailing List' > Subject: RE: [PHP-DEV] Return Type Hinting for Methods RFC > > Is this how it's done in Scala? > > Dmitri Snytkine > Web Developer > Ultra Logistics, Inc. > Phone: (888) 220-4640 x 2097 > Fax: (888) 795-6642 > E-Mail: dsnytkine@ultralogistics.com > Web: www.ultralogistics.com > > "A Top 100 Logistics I.T. Provider in 2011" > > > -----Original Message----- > From: =C3=81ngel Gonz=C3=A1lez [mailto:keisial@gmail.com] > Sent: Thursday, December 22, 2011 7:45 PM > To: PHP Developers Mailing List > Subject: Re: [PHP-DEV] Return Type Hinting for Methods RFC > >> (I'm unsure about the T_DOUBLE_ARROW, although for parsing, I feel >> there should be some token there before the class name, though I'm >> unconvinced on which) > > What about this? > > function foo (Class1 $a, Class2 $b) return Class3 { > /* Do something */ > return new Class3($a, $b); > } > > > -- > PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visi= t: http://www.php.net/unsub.php > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php >