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]
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php