Re: Return type hinting patch

From: Date: Sat, 26 Apr 2008 22:24:40 +0000
Subject: Re: Return type hinting patch
References: 1 2 3 4 5 6 7 8 9 10  Groups: php.internals 
Request: Send a blank email to internals+get-37254@lists.php.net to get a copy of this message
On Sat, Apr 26, 2008 at 2:06 PM, David Zülke <dz@bitxtender.com> wrote: > Wouldn't the most consistent way be to omit "function" altogether when > using a return type hint? > > public static function zomg() { > return $somethingArbitrary; > } > > public static string foo() { > return $mustBeString; > } > i think leaving 'function' in there makes sense because thats the way php currently works. otoh, should there ever be a type "function" (e.g. for anonymous funcs) down > the road, that'd mean trouble ;) wow; good point! maybe if anonymous functions are ever supported the type could be capitalized as in 'Function' public function Function doStuff() { return function() {} } -nathan

« previous php.internals (#37254) next »