Lots Of Silly Arguments

no-email (Greg Korba), Greg Korba
Wed, 10 Jul 2024 00:00:00 +0000

PHP 8.4 drops the requirement of parenthesis around the new operator: it is possible to directly call a method on it.
Then, it is also possible to use an object as a method, by creating the __invoke() magic method. In this case, it returns a new instance of the class.
Finally, it is possible to call a function whose name is the result of a previous call.
The final result is quite impressive.