3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public $a = 1; } static $propertyFetch = (new Foo())->a; static $nullsafePropertyFetch = (new Foo())?->a; // If you comment the next line, you'll see a fatal error on line 7 above static $arrowFunction = fn() => 1;
Output for 8.3.0 - 8.3.27, 8.4.1 - 8.4.15
Output for 8.2.0 - 8.2.29
Fatal error: Constant expression contains invalid operations in /in/LJ8pG on line 11
Process exited with code 255.

preferences:
60.57 ms | 407 KiB | 5 Q