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
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 27
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 27
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 22
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
filename:       /in/53hbg
function name:  (null)
number of ops:  48
compiled vars:  !0 = $argv, !1 = $i, !2 = $m, !3 = $o, !4 = $p, !5 = $a
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   ASSIGN                                           $7      !1, '4N4P9N7P1N1P2N2P'
         1        ASSIGN_DIM                                               !0, 1
         2        OP_DATA                                                  $7
   4     3        INIT_FCALL                                               'preg_match_all'
         4        SEND_VAL                                                 '%2F%28%5Cd%2B%29%28%5Cw%29%2F'
         5        FETCH_DIM_R                                      $8      !0, 1
         6        SEND_VAR                                                 $8
         7        SEND_REF                                                 !2
         8        SEND_VAL                                                 2
         9        DO_ICALL                                                 
   6    10        ASSIGN                                                   !3, ''
        11      > FE_RESET_R                                       $11     !2, ->27
        12    > > FE_FETCH_R                                               $11, !4, ->27
        13    >   INIT_FCALL                                               'str_pad'
        14        SEND_VAL                                                 ''
        15        FETCH_DIM_R                                      $12     !4, 1
        16        SEND_VAR                                                 $12
        17        FETCH_DIM_R                                      $13     !4, 2
        18        IS_EQUAL                                         ~14     $13, 'N'
        19      > JMPZ                                                     ~14, ->22
        20    >   QM_ASSIGN                                        ~15     '%3D'
        21      > JMP                                                      ->23
        22    >   QM_ASSIGN                                        ~15     '-'
        23    >   SEND_VAL                                                 ~15
        24        DO_ICALL                                         $16     
        25        ASSIGN_CONCAT                                 0          !3, $16
        26      > JMP                                                      ->12
        27    >   FE_FREE                                                  $11
   7    28        INIT_FCALL                                               'preg_replace'
        29        SEND_VAL                                                 '%2F.%2F'
        30        SEND_VAL                                                 '_'
        31        INIT_FCALL                                               'str_replace'
        32        SEND_VAL                                                 '--'
        33        SEND_VAL                                                 '-+'
        34        SEND_VAR                                                 !3
        35        DO_ICALL                                         $18     
        36        ASSIGN                                           $19     !3, $18
        37        SEND_VAR                                                 $19
        38        DO_ICALL                                         $20     
        39        ASSIGN                                                   !5, $20
   8    40        ROPE_INIT                                     6  ~23     !5
        41        ROPE_ADD                                      1  ~23     ~23, '%0A%0A%0A'
        42        ROPE_ADD                                      2  ~23     ~23, !3
        43        ROPE_ADD                                      3  ~23     ~23, '%0A%0A'
        44        ROPE_ADD                                      4  ~23     ~23, !5
        45        ROPE_END                                      5  ~22     ~23, '%0A'
        46        ECHO                                                     ~22
        47      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 7.3.0