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 $p)$o.=str_pad('',$p[1],$p[2]=='N'?'=':'-'); $a=preg_replace('/./','_',$o=str_replace('--','- ',$o)); echo("$a\n\n\n$o\n\n$a\n");
based on Bsj6I
Output for 4.3.0 - 7.2.0
______________________________ ====- - =========- - - -=-==- ______________________________