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 <cpri...@zerocue.com> 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:dsnytk...@ultralogistics.com]
> Sent: Friday, December 23, 2011 7:48 AM
> To: 'Ángel González'; '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: dsnytk...@ultralogistics.com
> Web: www.ultralogistics.com
>
> "A Top 100 Logistics I.T. Provider in 2011"
>
>
> -----Original Message-----
> From: Ángel González [mailto:keis...@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, visit: 
> http://www.php.net/unsub.php
>
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to