On 14/01/13 05:10, Paulo Henrique Torrens wrote: > Hi, > > I'm currently interested in two features I'd like to see in PHP; how do I > proceed to request/propose them? I'd be glad to help implementing them as > well, if necessary. You should propose it here and then create a rfc about it in the php wiki, which is finally voted.
> One of them is really simple, but would be helpful to people with different > coding styles > > class Test { > public function blabla() { > // ... > } // < the interpreter fails if there > // is a semicolon here, although > // some c++ programmers may be used > // to add it > }; I don't think this is a good addition. > And the other one would be multiple return values > > function multi() { > return 10, 20; > }; > function sum($a, $b) { > return $a + $b; > }; > > echo sum(multi()); // echoes 30 > > $x, $y = multi(); > > echo $y; // echoes 20 Are you aware that you could use arrays here? function multi() { return array(10, 20); } list($x, $y) = multi(); echo $y; // echoes 20 For passing to a new function it is a bit uglier but still easy: echo call_user_func_array('sum', multi()); // echoes 30 Functions could be changed to receive the members of an array as the different arguments, but that would conflict with passing an array as the first argument. It would be also harder to read the code, too. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php