3v4l.org

run code in 500+ PHP versions simultaneously
<?php class x { function __construct($i = 0) { echo __METHOD__.PHP_EOL;} function __invoke() { echo __METHOD__.PHP_EOL;} } $x = new x; $y = new $x()(); // identical to //$y = (new $x(0)) () var_dump($y); // NULL ?>
Output for 8.2.0 - 8.2.34, 8.3.0 - 8.3.16
Parse error: syntax error, unexpected token "(" in /in/7G8C7 on line 11
Process exited with code 255.
Output for 8.4.1 - 8.4.3
x::__construct x::__construct x::__invoke NULL

preferences:
31.37 ms | 1154 KiB | 8 Q