3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?hh class Test{ public static function process_single(mixed $arg):string{ if(is_array($arg){ $return = []; foreach($arg as $key => $value){ $return[] = "{$key}: ".self::process_single($value); } return '{'.implode(',',$return).'}'; }) return (string)$arg; } }
Output for 5.4.34 - 5.4.35
Parse error: syntax error, unexpected 'class' (T_CLASS) in /in/pk10b on line 2
Process exited with code 255.
Output for 5.4.0 - 5.4.32
<?hh class Test{ public static function process_single(mixed $arg):string{ if(is_array($arg){ $return = []; foreach($arg as $key => $value){ $return[] = "{$key}: ".self::process_single($value); } return '{'.implode(',',$return).'}'; }) return (string)$arg; } }