Re: [RFC] Return type-hint

From: Date: Thu, 28 Apr 2011 16:38:31 +0000
Subject: Re: [RFC] Return type-hint
References: 1 2 3 4 5  Groups: php.internals 
Request: Send a blank email to internals+get-52060@lists.php.net to get a copy of this message
On 29/04/11 2:10 AM, Alain Williams wrote:
On Fri, Apr 29, 2011 at 01:58:02AM +1000, Ben Schmidt wrote:
If PHP were compiled, not interpreted, i.e. less dynamic, there could be some benefits, as compile-time optimisations could perhaps be built in, and validations skipped if they were provably unnecessary. But that's not going to happen any time soon, as far as I'm aware.
It has already happened: https://github.com/facebook/hiphop-php/wiki/ It might also be useful for reflection.
*Hastily retracts comment.* That is very cool. I should give it a try. I also see the value of such type checking for such a use case, obviously. I guess there's a reason for it after all. I'd still like to see something neat to handle more than just named classes, though, e.g. scalars, and things like "false on error" for return values. Ben.

« previous php.internals (#52060) next »