3v4l.org

run code in 300+ PHP versions simultaneously
<?php <<ExampleAttribute>> class Foo { <<ExampleAttribute>> public const FOO = 'foo'; <<ExampleAttribute>> public $x; <<ExampleAttribute>> public function foo(<<ExampleAttribute>> $bar) { } } $object = new <<ExampleAttribute>> class () { }; <<ExampleAttribute>> function f1() { } $f2 = <<ExampleAttribute>> function () { }; $f3 = <<ExampleAttribute>> fn () => 1;
Output for 8.0.0, 8.2.2
Parse error: syntax error, unexpected token "<<", expecting end of file in /in/QSKWE on line 3
Process exited with code 255.
Output for 7.2.0 - 7.2.34, 7.3.0 - 7.3.25, 7.4.0 - 7.4.13
Parse error: syntax error, unexpected '<<' (T_SL), expecting end of file in /in/QSKWE on line 3
Process exited with code 255.

preferences:
191.48 ms | 1395 KiB | 84 Q