3v4l.org

run code in 300+ PHP versions simultaneously
<?php class B { public static addHello( $string ) { return $string . ' Hello!'; } } class A { public static function test() { $B = new B(); $name = 'Eugene'; return $B->addHello( $name ); } } A::test();
Output for 5.4.0 - 5.4.23
Parse error: syntax error, unexpected 'addHello' (T_STRING), expecting variable (T_VARIABLE) in /in/c8Fj1 on line 5
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE in /in/c8Fj1 on line 5
Process exited with code 255.

preferences:
169.97 ms | 1395 KiB | 60 Q