I keep on stumbling on this PHP quirk and can't seem to explain myself why it's happening.
Why does this
new MyClass()->doSomething();
Trigger an error, while
(new MyClass())->doSomething();
and
$myObject = new MyClass();
$myObject->doSomething();
work as expected?
Is there a valid reason for needing the brackets around the constructor?
I found this RFC explaining that it was a conscious choice, but I still can't seem to understand the reason for it.