3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $i='4N4P9N7P1N1P2N2P'; preg_match_all('/(\d+)(\w)/',$i,$m,2); //foreach($m as $p){$k=$p[1];$o.=($p[2]=='N')?str_repeat('=',$k):str_repeat('- ',$k/2-$k%2).($k%2?'-':'');} foreach($m as $p)$o.=str_repeat($p[2]=='N'?'=':'-',$p[1]); $o=str_replace('--','- ',$o); $a=str_repeat('_',$n=strlen($o)); echo("$a\n\n\n$o\n\n$a\n");
based on 5YbBW
Output for 5.0.4 - 7.2.0
Notice: Undefined variable: o in /in/v8Nvk on line 6 ______________________________ ====- - =========- - - -=-==- ______________________________
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: o in /in/v8Nvk on line 6 ______________________________ ====- - =========- - - -=-==- ______________________________