__invoke() On New

no-email (Damien Seguy), Damien Seguy
Mon, 27 Jan 2025 00:00:00 +0000

It is possible to create a new object by calling new on a previous object: PHP fetches the name of the class, then its constructor.
With the PHP 8.4 new syntax without parenthesis, it is also possible to chain the instantiation with a direct call. This calls the ``__invoke`` method.
This was not possible in previous versions.