3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public static $arr = array("test"); function bar( $str ){ var_dump(self::arr[0]); if( is_callable( self::arr[0],true ) ){ ({self::arr[0]})( $str ); } } static function test($var) { echo "Testing: $var\n"; } } (new Foo)->bar("bla");
Output for 5.6.8 - 5.6.17, 7.0.0 - 7.0.2
Parse error: syntax error, unexpected '{' in /in/amZLN on line 9
Process exited with code 255.
Output for 5.5.24 - 5.5.31
Parse error: syntax error, unexpected '[' in /in/amZLN on line 7
Process exited with code 255.

preferences:
171.69 ms | 1394 KiB | 28 Q