3v4l.org

run code in 300+ PHP versions simultaneously
<?php $i='4N4P9N7P1N1P2N2P'; preg_match_all('/(\d+)(\w)/',$i,$m,2); print_r($m); foreach($m as $p) { if ($p[2]=='N') { $o.=str_repeat('=',$p[1]); } else { $o.=str_repeat('- ',(int)($p[1]/2)).($p%2?'-':''); } } echo($o);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 37
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 37
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 22
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 36
Branch analysis from position: 36
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 22
2 jumps found. (Code = 43) Position 1 = 31, Position 2 = 33
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 33
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 37
filename:       /in/UN52a
function name:  (null)
number of ops:  40
compiled vars:  !0 = $i, !1 = $m, !2 = $p, !3 = $o
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '4N4P9N7P1N1P2N2P'
    4     1        INIT_FCALL                                               'preg_match_all'
          2        SEND_VAL                                                 '%2F%28%5Cd%2B%29%28%5Cw%29%2F'
          3        SEND_VAR                                                 !0
          4        SEND_REF                                                 !1
          5        SEND_VAL                                                 2
          6        DO_ICALL                                                 
    5     7        INIT_FCALL                                               'print_r'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                                 
    6    10      > FE_RESET_R                                       $7      !1, ->37
         11    > > FE_FETCH_R                                               $7, !2, ->37
    7    12    >   FETCH_DIM_R                                      ~8      !2, 2
         13        IS_EQUAL                                                 ~8, 'N'
         14      > JMPZ                                                     ~9, ->22
    8    15    >   INIT_FCALL                                               'str_repeat'
         16        SEND_VAL                                                 '%3D'
         17        FETCH_DIM_R                                      ~10     !2, 1
         18        SEND_VAL                                                 ~10
         19        DO_ICALL                                         $11     
         20        ASSIGN_OP                                     8          !3, $11
         21      > JMP                                                      ->36
   10    22    >   INIT_FCALL                                               'str_repeat'
         23        SEND_VAL                                                 '-+'
         24        FETCH_DIM_R                                      ~13     !2, 1
         25        DIV                                              ~14     ~13, 2
         26        CAST                                          4  ~15     ~14
         27        SEND_VAL                                                 ~15
         28        DO_ICALL                                         $16     
         29        MOD                                              ~17     !2, 2
         30      > JMPZ                                                     ~17, ->33
         31    >   QM_ASSIGN                                        ~18     '-'
         32      > JMP                                                      ->34
         33    >   QM_ASSIGN                                        ~18     ''
         34    >   CONCAT                                           ~19     $16, ~18
         35        ASSIGN_OP                                     8          !3, ~19
    6    36    > > JMP                                                      ->11
         37    >   FE_FREE                                                  $7
   13    38        ECHO                                                     !3
         39      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173 ms | 1400 KiB | 19 Q