Re: Request for comments - new PHP feature: return typing

From: Date: Wed, 26 Jun 2013 14:21:13 +0000
Subject: Re: Request for comments - new PHP feature: return typing
References: 1 2 3 4 5  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
2013/6/26 Julien Pauli <[email protected]>:
> But what Sherif said proves as well the limits of the idea. PHP is not
> strongly typed. So each check, should it be type hinting or return type
> hinting, has to be done at runtime , which is bad for performances.

It doesn't mean you have to use it, just that it might be used instead
of implementing a manual check in every function/method callers, or,
alternatively, in the function/method itself.
Being done at runtime by the language will for sure not be worst for
performance than doing it manually in pure PHP.

> Not talking about the type juggling which could lead the programmer as
> shooting himself.

Sure! Hence why *if* this is taken into account, it should really be
done the same way as it is done for input parameter hinting, to not
introduce what we already don't want there.


Thread (35 messages)

« previous php.internals (#67871) next »