3v4l.org

run code in 300+ PHP versions simultaneously
<?php $i='4N4P9N7P1N1P2N2P'; preg_match_all('/(\d+)(\w)/', $i, $m); //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(PREG_SET_ORDER); echo($o);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 33
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 33
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 18
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 29
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 33
filename:       /in/3ofjm
function name:  (null)
number of ops:  37
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        DO_ICALL                                                 
    6     6      > FE_RESET_R                                       $6      !1, ->33
          7    > > FE_FETCH_R                                               $6, !2, ->33
    7     8    >   FETCH_DIM_R                                      ~7      !2, 2
          9        IS_EQUAL                                                 ~7, 'N'
         10      > JMPZ                                                     ~8, ->18
    8    11    >   INIT_FCALL                                               'str_repeat'
         12        SEND_VAL                                                 '%3D'
         13        FETCH_DIM_R                                      ~9      !2, 1
         14        SEND_VAL                                                 ~9
         15        DO_ICALL                                         $10     
         16        ASSIGN_OP                                     8          !3, $10
         17      > JMP                                                      ->32
   10    18    >   INIT_FCALL                                               'str_repeat'
         19        SEND_VAL                                                 '-+'
         20        FETCH_DIM_R                                      ~12     !2, 1
         21        DIV                                              ~13     ~12, 2
         22        CAST                                          4  ~14     ~13
         23        SEND_VAL                                                 ~14
         24        DO_ICALL                                         $15     
         25        MOD                                              ~16     !2, 2
         26      > JMPZ                                                     ~16, ->29
         27    >   QM_ASSIGN                                        ~17     '-'
         28      > JMP                                                      ->30
         29    >   QM_ASSIGN                                        ~17     ''
         30    >   CONCAT                                           ~18     $15, ~17
         31        ASSIGN_OP                                     8          !3, ~18
    6    32    > > JMP                                                      ->7
         33    >   FE_FREE                                                  $6
   13    34        ECHO                                                     2
   14    35        ECHO                                                     !3
         36      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.98 ms | 1400 KiB | 17 Q