3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
190.51 ms | 1400 KiB | 21 Q