Re: Cascade Operator (was Re: [PHP-DEV] Proposal for php7 class method return)
| From: | Rowan Collins | Date: | Mon, 11 Jul 2016 15:42:15 +0000 |
| Subject: | Re: Cascade Operator (was Re: [PHP-DEV] Proposal for php7 class method return) | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-94469@lists.php.net to get a copy of this message | ||
On 11/07/2016 16:33, Marco Pivetta wrote:
Still interested: what's the actual added value of this sort of operator?Arguably, the same value there is any syntax. You could say that the -> operator is just a more readable form of overloaded function calls: class Something { function bar(int $value); } $foo->bar(42); vs function bar(@overload Something $this, int $value); bar($foo, 42); And, indeed, that all operators are just a more readable form of function calls. Chaining syntax makes a certain style of programming easier. It doesn't allow you to do anything that you can't do without it, and the change is mostly cosmetic. Whether that's a good thing or bad thing depends whether you think that's a good style or not. A bit of a non-answer, perhaps, but the question is pretty woolly too. Regards, -- Rowan Collins [IMSoP]