Much cleaner syntax and much easier to write. Adding parenthesis has always felt a bit clunky and unnecessary. This would remove the need for a static method for the sake of method chaining.
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.
I'm not sure if allowing default implementations in interfaces is the way to go here.
To me it looks like a workaround / hack for non existing multi inheritance.
Why not either make multi inheritance possible instead or allow traits with interfaces as suggested by Victor?
We spend a lot more time reading code than writing it. The elegance of short closure combined with the convenience of variable scope usage has already shown to be a game changer on Typescript and there doesn’t seem to be any technical issue with having it on PHP.
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...