> On 4 Nov 2014, at 08:51, Stas Malyshev <smalys...@sugarcrm.com> wrote:
> 
> I agree, this is not a very good situation. It would be much better to
> take a systematic approach to this, but this is impossible since there
> is no systematic approach to strict typing in PHP, just some pieces here
> and there. I think this is not right, but obviously many people here
> disagree and are happy to have the inconsistent syntax. I don't see why
> "public Foo function bar()" would be so much worse than "public function
> bar() : Foo"  but for some reason this possibility wasn't even
> considered as far as I can see.

I thought it was inconsistent, but after discussions on StackOverflow, I don't 
think it actually is. Return types describe the return type of a function, not 
the type of a function. So there's no reason they have to go before the 
function name like parameter types do.

Also, it's worth bearing in mind that `public Foo function` was rejected 
previously.

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

Reply via email to