3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $argv[1]=$i='4N4P9N7P1N1P2N2P'; preg_match_all('/(\d+)(\w)/',$argv[1],$m,2); //$o='';foreach($m as $p)$o.=str_repeat($p[2]=='N'?'=':'-',$p[1]); $o='';foreach($m as list(,$n,$c))$o.=str_pad('',$n,$c=='N'?'=':'-'); $a=preg_replace('/./','_',$o=str_replace('--','- ',$o)); echo("$a\n\n\n$o\n\n$a\n");
based on QjXtq
Output for 5.5.24 - 7.2.0
______________________________ ====- - =========- - - -=-==- ______________________________
Output for 5.4.0 - 5.4.45
Parse error: syntax error, unexpected 'list' (T_LIST) in /in/Zk1kK on line 6
Process exited with code 255.
Output for 5.3.0 - 5.3.29
Parse error: syntax error, unexpected T_LIST in /in/Zk1kK on line 6
Process exited with code 255.
Output for 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_LIST, expecting '&' or T_STRING or T_VARIABLE or '$' in /in/Zk1kK on line 6
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_LIST, expecting '&' or T_STRING or T_VARIABLE or '$' in /in/Zk1kK on line 6
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_LIST, expecting T_VARIABLE or '$' in /in/Zk1kK on line 6
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_LIST, expecting T_VARIABLE or '$' in /in/Zk1kK on line 6
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_VARIABLE' or `'$'' in /in/Zk1kK on line 6
Process exited with code 255.