Re: FW: Functionality request/proposal
On Mon, 2013-01-14 at 04:10 +0000, 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.
>
>
> 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
That one is wrong in C++, too. Unless you're confusing function
declarition with function definitions.
class CPPClass {
void some_declaration();
void some_definition_of_an_inline_function() {
return;
} // No ; here
}
> };
Well, people should be aware of the language they are using ...
> And the other one would be multiple return values
>
> function multi() {
> return 10, 20;
Use
return [10, 20];
which exists and returns an array. This is clear and quite easy to read.
> };
> function sum($a, $b) {
> return $a + $b;
> };
>
> echo sum(multi()); // echoes 30
This becomes confusing when reading.
johannes
Thread (7 messages)