3v4l.org

run code in 300+ PHP versions simultaneously
<?php $map = ' \\ / / / / / \\ \\ \\ / \\ /\\ \\/ \\ / \\ \\ \\ \\ \\ \\ / /'; var_dump( r($map)); function r($m){ $z=strpos($m,"/\\"); $z-=strrpos(substr($m,0,$z),"\n"); $ls=explode("\n",$m);$i=0; $a=[1=>0,2=>0,3=>0,4=>0]; foreach($ls as $l){ $y=$i<count($ls)/2?0:1;//echo $y+0+($y?2:1); $s = substr($l,0,$z-1); $a[$y+0+($y?2:1)][] = strpos($s,"/")?"1":(strpos($s,"\\")?"2":"3"); $s = substr($l,$z); $a[$y+1+($y?2:1)][] = strpos($s,"/")?"1":(strpos($s,"\\")?"2":"3"); $i++; } return $a; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AUaEb
function name:  (null)
number of ops:  8
compiled vars:  !0 = $map
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '++++++++++++++++++%5C%0A++++++%2F++++++++++%2F%0A+++++++%2F++++++++%2F%0A++++++++%2F++++++%5C%0A+++++++++%5C++++%5C%0A++++++++++%2F++%5C%0A+++++++++++%2F%5C%0A+++++++++++%5C%2F%0A++++++++++%5C++%2F%0A+++++++++%5C++++%5C%0A++++++++%5C++++++%5C%0A+++++++%5C++++++++%5C%0A++++++%2F++++++++++%2F'
   15     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL_BY_NAME                                       'r'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0  $2      
          5        SEND_VAR                                                 $2
          6        DO_ICALL                                                 
   31     7      > RETURN                                                   1

Function r:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 24, Position 2 = 97
Branch analysis from position: 24
2 jumps found. (Code = 78) Position 1 = 25, Position 2 = 97
Branch analysis from position: 25
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 31
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
2 jumps found. (Code = 43) Position 1 = 42, Position 2 = 44
Branch analysis from position: 42
1 jumps found. (Code = 42) Position 1 = 45
Branch analysis from position: 45
2 jumps found. (Code = 43) Position 1 = 51, Position 2 = 53
Branch analysis from position: 51
1 jumps found. (Code = 42) Position 1 = 62
Branch analysis from position: 62
2 jumps found. (Code = 43) Position 1 = 72, Position 2 = 74
Branch analysis from position: 72
1 jumps found. (Code = 42) Position 1 = 75
Branch analysis from position: 75
2 jumps found. (Code = 43) Position 1 = 81, Position 2 = 83
Branch analysis from position: 81
1 jumps found. (Code = 42) Position 1 = 92
Branch analysis from position: 92
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
Branch analysis from position: 83
2 jumps found. (Code = 43) Position 1 = 88, Position 2 = 90
Branch analysis from position: 88
1 jumps found. (Code = 42) Position 1 = 91
Branch analysis from position: 91
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
Branch analysis from position: 90
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
Branch analysis from position: 74
2 jumps found. (Code = 43) Position 1 = 81, Position 2 = 83
Branch analysis from position: 81
Branch analysis from position: 83
Branch analysis from position: 53
2 jumps found. (Code = 43) Position 1 = 58, Position 2 = 60
Branch analysis from position: 58
1 jumps found. (Code = 42) Position 1 = 61
Branch analysis from position: 61
2 jumps found. (Code = 43) Position 1 = 72, Position 2 = 74
Branch analysis from position: 72
Branch analysis from position: 74
Branch analysis from position: 60
2 jumps found. (Code = 43) Position 1 = 72, Position 2 = 74
Branch analysis from position: 72
Branch analysis from position: 74
Branch analysis from position: 44
2 jumps found. (Code = 43) Position 1 = 51, Position 2 = 53
Branch analysis from position: 51
Branch analysis from position: 53
Branch analysis from position: 31
2 jumps found. (Code = 43) Position 1 = 42, Position 2 = 44
Branch analysis from position: 42
Branch analysis from position: 44
Branch analysis from position: 97
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 97
filename:       /in/AUaEb
function name:  r
number of ops:  100
compiled vars:  !0 = $m, !1 = $z, !2 = $ls, !3 = $i, !4 = $a, !5 = $l, !6 = $y, !7 = $s
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   18     1        INIT_FCALL                                               'strpos'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 '%2F%5C'
          4        DO_ICALL                                         $8      
          5        ASSIGN                                                   !1, $8
   19     6        INIT_FCALL                                               'strrpos'
          7        INIT_FCALL                                               'substr'
          8        SEND_VAR                                                 !0
          9        SEND_VAL                                                 0
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                         $10     
         12        SEND_VAR                                                 $10
         13        SEND_VAL                                                 '%0A'
         14        DO_ICALL                                         $11     
         15        ASSIGN_OP                                     2          !1, $11
   20    16        INIT_FCALL                                               'explode'
         17        SEND_VAL                                                 '%0A'
         18        SEND_VAR                                                 !0
         19        DO_ICALL                                         $13     
         20        ASSIGN                                                   !2, $13
         21        ASSIGN                                                   !3, 0
   21    22        ASSIGN                                                   !4, <array>
   22    23      > FE_RESET_R                                       $17     !2, ->97
         24    > > FE_FETCH_R                                               $17, !5, ->97
   23    25    >   COUNT                                            ~18     !2
         26        DIV                                              ~19     ~18, 2
         27        IS_SMALLER                                               !3, ~19
         28      > JMPZ                                                     ~20, ->31
         29    >   QM_ASSIGN                                        ~21     0
         30      > JMP                                                      ->32
         31    >   QM_ASSIGN                                        ~21     1
         32    >   ASSIGN                                                   !6, ~21
   24    33        INIT_FCALL                                               'substr'
         34        SEND_VAR                                                 !5
         35        SEND_VAL                                                 0
         36        SUB                                              ~23     !1, 1
         37        SEND_VAL                                                 ~23
         38        DO_ICALL                                         $24     
         39        ASSIGN                                                   !7, $24
   25    40        ADD                                              ~26     !6, 0
         41      > JMPZ                                                     !6, ->44
         42    >   QM_ASSIGN                                        ~27     2
         43      > JMP                                                      ->45
         44    >   QM_ASSIGN                                        ~27     1
         45    >   ADD                                              ~28     ~26, ~27
         46        INIT_FCALL                                               'strpos'
         47        SEND_VAR                                                 !7
         48        SEND_VAL                                                 '%2F'
         49        DO_ICALL                                         $31     
         50      > JMPZ                                                     $31, ->53
         51    >   QM_ASSIGN                                        ~32     '1'
         52      > JMP                                                      ->62
         53    >   INIT_FCALL                                               'strpos'
         54        SEND_VAR                                                 !7
         55        SEND_VAL                                                 '%5C'
         56        DO_ICALL                                         $33     
         57      > JMPZ                                                     $33, ->60
         58    >   QM_ASSIGN                                        ~34     '2'
         59      > JMP                                                      ->61
         60    >   QM_ASSIGN                                        ~34     '3'
         61    >   QM_ASSIGN                                        ~32     ~34
         62    >   FETCH_DIM_W                                      $29     !4, ~28
         63        ASSIGN_DIM                                               $29
         64        OP_DATA                                                  ~32
   26    65        INIT_FCALL                                               'substr'
         66        SEND_VAR                                                 !5
         67        SEND_VAR                                                 !1
         68        DO_ICALL                                         $35     
         69        ASSIGN                                                   !7, $35
   27    70        ADD                                              ~37     !6, 1
         71      > JMPZ                                                     !6, ->74
         72    >   QM_ASSIGN                                        ~38     2
         73      > JMP                                                      ->75
         74    >   QM_ASSIGN                                        ~38     1
         75    >   ADD                                              ~39     ~37, ~38
         76        INIT_FCALL                                               'strpos'
         77        SEND_VAR                                                 !7
         78        SEND_VAL                                                 '%2F'
         79        DO_ICALL                                         $42     
         80      > JMPZ                                                     $42, ->83
         81    >   QM_ASSIGN                                        ~43     '1'
         82      > JMP                                                      ->92
         83    >   INIT_FCALL                                               'strpos'
         84        SEND_VAR                                                 !7
         85        SEND_VAL                                                 '%5C'
         86        DO_ICALL                                         $44     
         87      > JMPZ                                                     $44, ->90
         88    >   QM_ASSIGN                                        ~45     '2'
         89      > JMP                                                      ->91
         90    >   QM_ASSIGN                                        ~45     '3'
         91    >   QM_ASSIGN                                        ~43     ~45
         92    >   FETCH_DIM_W                                      $40     !4, ~39
         93        ASSIGN_DIM                                               $40
         94        OP_DATA                                                  ~43
   28    95        PRE_INC                                                  !3
   22    96      > JMP                                                      ->24
         97    >   FE_FREE                                                  $17
   30    98      > RETURN                                                   !4
   31    99*     > RETURN                                                   null

End of function r

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
177.31 ms | 1408 KiB | 23 Q