Re: Q on Primitives

From: Date: Fri, 19 Dec 2008 14:31:40 +0000
Subject: Re: Q on Primitives
References: 1 2 3 4 5 6 7 8  Groups: php.internals php.internals 
Request: Send a blank email to internals+get-42347@lists.php.net to get a copy of this message
Robin Burchell wrote:
Just a random thought I have from reading over that: Would it not be more 'natural' to change 'function' to indicate a method with a variant return type, and allow e.g. 'int somefunc()' instead of 'function (int) somefunc()' to indicate an int return?
it would break all php code existing so far; the only real way to implement return value types would be as such public static function somefunc():int { this would allow the return type to be optional and leave all existing code functional; likewise it could be implemented for any style of php'ing, thus: #php4 style class method or normal procedural function function dosumit():int { type hints are all ready there so adding primitives /should/ be possible without any bc issues

« previous php.internals (#42347) next »