3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public static function bar() { return 1; } private static function baz() { return 2; } } function mapIt( callable $mapper ) { $a = array( 1, 2, 3 ); return array_map( $mapper, $a ); } $f = new Foo(); var_dump( mapIt( array( $f, 'bar' ) ); var_dump( mapIt( array( $f, 'baz' ) );
Output for 5.5.24 - 5.5.30, 5.6.8 - 5.6.16
Parse error: syntax error, unexpected ';' in /in/bO6Yt on line 18
Process exited with code 255.

preferences:
165.37 ms | 1395 KiB | 23 Q