Re: Raising the precedence of the new operator

From: Date: Mon, 05 Apr 2021 20:26:52 +0000
Subject: Re: Raising the precedence of the new operator
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-113966@lists.php.net to get a copy of this message
Hi!

On 4/5/21 9:40 AM, André Hänsel wrote:
I was wondering... PHP is the only language I know of where you have to write (new Foo())->bar() instead of new Foo()->bar(). This is particularly apparent with the builder pattern:
Enabling something that is syntax error now sounds pretty innocent, but I wonder if messing with precedence would cause some deeper consequences in different expressions. We need to be careful here given how much code (and how much weird code) there exists in PHP. If we can guarantee that we can enable this construct without causing any side effects, then it's fine I think. -- Stas Malyshev smalyshev@gmail.com

Thread (14 messages)

« previous php.internals (#113966) next »