3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $argv[1]=$i='4N4P19N7P1N1P2N2P'; preg_match_all('/(\d+)(\w)/',$argv[1],$m,2); $o='';foreach($m as $p)$o.=str_repeat($p[2]=='N'?'=':'-',$p[1]); //$a=str_repeat('_',$n=strlen($o=str_replace('--','- ',$o))); $a=preg_replace('/./','_',$o=str_replace('--','- ',$o)); echo("$a\n\n\n$o\n\n$a\n");
based on BBGXQ
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 26
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 26
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 19
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
filename:       /in/Bsj6I
function name:  (null)
number of ops:  47
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, '4N4P19N7P1N1P2N2P'
         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                                                 
   5    10        ASSIGN                                                   !3, ''
        11      > FE_RESET_R                                       $11     !2, ->26
        12    > > FE_FETCH_R                                               $11, !4, ->26
        13    >   INIT_FCALL                                               'str_repeat'
        14        FETCH_DIM_R                                      $12     !4, 2
        15        IS_EQUAL                                         ~13     $12, 'N'
        16      > JMPZ                                                     ~13, ->19
        17    >   QM_ASSIGN                                        ~14     '%3D'
        18      > JMP                                                      ->20
        19    >   QM_ASSIGN                                        ~14     '-'
        20    >   SEND_VAL                                                 ~14
        21        FETCH_DIM_R                                      $15     !4, 1
        22        SEND_VAR                                                 $15
        23        DO_ICALL                                         $16     
        24        ASSIGN_CONCAT                                 0          !3, $16
        25      > JMP                                                      ->12
        26    >   FE_FREE                                                  $11
   7    27        INIT_FCALL                                               'preg_replace'
        28        SEND_VAL                                                 '%2F.%2F'
        29        SEND_VAL                                                 '_'
        30        INIT_FCALL                                               'str_replace'
        31        SEND_VAL                                                 '--'
        32        SEND_VAL                                                 '-+'
        33        SEND_VAR                                                 !3
        34        DO_ICALL                                         $18     
        35        ASSIGN                                           $19     !3, $18
        36        SEND_VAR                                                 $19
        37        DO_ICALL                                         $20     
        38        ASSIGN                                                   !5, $20
   8    39        ROPE_INIT                                     6  ~23     !5
        40        ROPE_ADD                                      1  ~23     ~23, '%0A%0A%0A'
        41        ROPE_ADD                                      2  ~23     ~23, !3
        42        ROPE_ADD                                      3  ~23     ~23, '%0A%0A'
        43        ROPE_ADD                                      4  ~23     ~23, !5
        44        ROPE_END                                      5  ~22     ~23, '%0A'
        45        ECHO                                                     ~22
        46      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 7.3.0