3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function test(self $obj) { } public function testStatic(static $obj) { } } class bar extends Foo{} $foo = new foo(); $bar = new Bar(); $foo->test($foo); $foo->test($bar); $bar->testStatic($bar); $bar->testStatic($foo);
Output for 5.6.0 - 5.6.24, 7.0.0 - 7.0.9
Parse error: syntax error, unexpected 'static' (T_STATIC), expecting variable (T_VARIABLE) in /in/Auj2n on line 9
Process exited with code 255.

preferences:
152.54 ms | 1399 KiB | 42 Q