It just makes sense and also optional, so whoever doesn't like it can go back to using parentheses.
Every time I find myself typing new MyClass()
and than returning back and adding those parentheses. It would be good to reduce this friction and make PHP coding flow smoother.
Often, I add static methods to some classes in order to improve readability when I instantiate a new class; the ability of chaining methods directly to the constructor, without the unnecessary parenthesis boilerplate, would remove the need for that.
Just for the sake of code readability improvements & not needing to use the use keyword, It has my full support. Other languages have solved the issue, why not PHP aswell?
With First-class callable syntax available since 8.1, it would now be possible to write it as below, which is much better then string names of functions:
$result = "Hello World" |> htmlentities(...) |> str_split(...) |> fn($x) => array_map(strtoupper(...), $x) |> fn($x) => array_filter($x, fn($v) => $v != 'O');
I really do not want to see this in PHP because it tempts to apply closures on everything. The question is not if we can but if we should.
PHP is evolving. There are new concepts added to many programming languages to ease writing and reading (more important!). PHP should focus more on developer experience (but not for legacy projects that get never upgraded to PHP 8+).
At least once a week, I throw away an array_map because it ended up looking too bloated and go with a classic foreach instead. Short Closures 2.0 without the use(...) block would've solved this problem, just 2 votes...