Re: [PHP-DEV] Suggested change: change priority of new and ->

2018-02-17 Thread Mcmuffin Mcguffin
> > Is that creating an instance of the class name stored in the 0th index of > the array $var or is it creating an instance of the class name stored in > $var and accessing the 0th index using ArrayAccess? > As soon as $var gets involved, it should be prioritized above the new operator. So it's

[PHP-DEV] Suggested change: change priority of new and ->

2018-02-08 Thread Mcmuffin Mcguffin
Hi, It's a common idiom in object-oriented languages to create an object and then immediately call a method on it, such as (in C# or Java): new DateTime ().ToString () However, PHP grammar does not work this way. You have to put an additional round of parentheses around new clause, such as: