3v4l.org

run code in 300+ PHP versions simultaneously
<?php $types = array('Normal','Fighting','Flying','Poison','Ground','Rock','Bug','Ghost','Steel','Fire','Water','Grass','Electric','Psychic','Ice','Dragon','Dark','Fairy',); $effect_vals = array( array(1, 1, 1, 1, 1,.5, 1, 0,.5, 1, 1, 1, 1, 1, 1, 1, 1, 1), array(2, 1,.5,.5, 1, 2,.5, 0, 2, 1, 1, 1, 1,.5, 2, 1, 2,.5), array(1, 2, 1, 1, 1,.5, 2, 1,.5, 1, 1, 2,.5, 1, 1, 1, 1, 1), array(1, 1, 1,.5,.5,.5, 1,.5, 0, 1, 1, 2, 1, 1, 1, 1, 1, 2), array(1, 1, 0, 2, 1, 2,.5, 1, 2, 2, 1,.5, 2, 1, 1, 1, 1, 1), array(1,.5, 2, 1,.5, 1, 2, 1,.5, 2, 1, 1, 1, 1, 2, 1, 1, 1), array(1,.5,.5,.5, 1, 1, 1,.5,.5,.5, 1, 2, 1, 2, 1, 1, 2,.5), array(0, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1,.5, 1), array(1, 1, 1, 1, 1, 2, 1, 1,.5,.5,.5, 1,.5, 1, 2, 1, 1, 2), array(1, 1, 1, 1, 1,.5, 2, 1, 2,.5,.5, 2, 1, 1, 2,.5, 1, 1), array(1, 1, 1, 1, 2, 2, 1, 1, 1, 2,.5,.5, 1, 1, 1,.5, 1, 1), array(1, 1,.5,.5, 2, 2,.5, 1,.5,.5, 2,.5, 1, 1, 1,.5, 1, 1), array(1, 1, 2, 1, 0, 1, 1, 1, 1, 1, 2,.5,.5, 1, 1,.5, 1, 1), array(1, 2, 1, 2, 1, 1, 1, 1,.5, 1, 1, 1, 1,.5, 1, 1, 0, 1), array(1, 1, 2, 1, 2, 1, 1, 1,.5,.5,.5, 2, 1, 1,.5, 2, 1, 1), array(1, 1, 1, 1, 1, 1, 1, 1,.5, 1, 1, 1, 1, 1, 1, 2, 1, 0), array(1,.5, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1,.5,.5), array(1, 2, 1,.5, 1, 1, 1, 1,.5,.5, 1, 1, 1, 1, 1, 2, 2, 1), ); $effect = array(); foreach($types as $d_key => $defending){ foreach($types as $a_key => $attacking){ $effect[$defending][$attacking] = $effect_vals[$d_key][$a_key]; } } foreach($effect as $key => $child){ reset($effect); echo key($effect) === $key ? str_pad(substr($key, 0, 3), 7, " ", STR_PAD_LEFT) : str_pad(substr($key, 0, 3), 6, " ", STR_PAD_LEFT); } foreach($effect as $key => $child){ echo "\n" . substr($key, 0, 3); foreach($child as $c_key => $value){ reset($child); echo key($child) === $c_key ? str_pad(substr($value, 0, 3), 4, " ", STR_PAD_LEFT) : str_pad(substr($value, 0, 3), 6, " ", STR_PAD_LEFT); } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 17
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 17
Branch analysis from position: 5
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 15
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 15
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 15
Branch analysis from position: 17
2 jumps found. (Code = 77) Position 1 = 19, Position 2 = 56
Branch analysis from position: 19
2 jumps found. (Code = 78) Position 1 = 20, Position 2 = 56
Branch analysis from position: 20
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 42
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 54
Branch analysis from position: 54
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
Branch analysis from position: 42
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
Branch analysis from position: 56
2 jumps found. (Code = 77) Position 1 = 58, Position 2 = 107
Branch analysis from position: 58
2 jumps found. (Code = 78) Position 1 = 59, Position 2 = 107
Branch analysis from position: 59
2 jumps found. (Code = 77) Position 1 = 68, Position 2 = 105
Branch analysis from position: 68
2 jumps found. (Code = 78) Position 1 = 69, Position 2 = 105
Branch analysis from position: 69
2 jumps found. (Code = 43) Position 1 = 78, Position 2 = 91
Branch analysis from position: 78
1 jumps found. (Code = 42) Position 1 = 103
Branch analysis from position: 103
1 jumps found. (Code = 42) Position 1 = 68
Branch analysis from position: 68
Branch analysis from position: 91
1 jumps found. (Code = 42) Position 1 = 68
Branch analysis from position: 68
Branch analysis from position: 105
1 jumps found. (Code = 42) Position 1 = 58
Branch analysis from position: 58
Branch analysis from position: 105
Branch analysis from position: 107
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 107
Branch analysis from position: 56
Branch analysis from position: 17
filename:       /in/GWRqG
function name:  (null)
number of ops:  109
compiled vars:  !0 = $types, !1 = $effect_vals, !2 = $effect, !3 = $defending, !4 = $d_key, !5 = $attacking, !6 = $a_key, !7 = $child, !8 = $key, !9 = $value, !10 = $c_key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        ASSIGN                                                   !1, <array>
   26     2        ASSIGN                                                   !2, <array>
   27     3      > FE_RESET_R                                       $14     !0, ->17
          4    > > FE_FETCH_R                                       ~15     $14, !3, ->17
          5    >   ASSIGN                                                   !4, ~15
   28     6      > FE_RESET_R                                       $17     !0, ->15
          7    > > FE_FETCH_R                                       ~18     $17, !5, ->15
          8    >   ASSIGN                                                   !6, ~18
   29     9        FETCH_DIM_R                                      ~22     !1, !4
         10        FETCH_DIM_R                                      ~23     ~22, !6
         11        FETCH_DIM_W                                      $20     !2, !3
         12        ASSIGN_DIM                                               $20, !5
         13        OP_DATA                                                  ~23
   28    14      > JMP                                                      ->7
         15    >   FE_FREE                                                  $17
   27    16      > JMP                                                      ->4
         17    >   FE_FREE                                                  $14
   33    18      > FE_RESET_R                                       $24     !2, ->56
         19    > > FE_FETCH_R                                       ~25     $24, !7, ->56
         20    >   ASSIGN                                                   !8, ~25
   34    21        INIT_FCALL                                               'reset'
         22        SEND_REF                                                 !2
         23        DO_ICALL                                                 
   35    24        INIT_FCALL                                               'key'
         25        SEND_VAR                                                 !2
         26        DO_ICALL                                         $28     
         27        IS_IDENTICAL                                             !8, $28
         28      > JMPZ                                                     ~29, ->42
   36    29    >   INIT_FCALL                                               'str_pad'
         30        INIT_FCALL                                               'substr'
         31        SEND_VAR                                                 !8
         32        SEND_VAL                                                 0
         33        SEND_VAL                                                 3
         34        DO_ICALL                                         $30     
         35        SEND_VAR                                                 $30
         36        SEND_VAL                                                 7
         37        SEND_VAL                                                 '+'
         38        SEND_VAL                                                 0
         39        DO_ICALL                                         $31     
         40        QM_ASSIGN                                        ~32     $31
         41      > JMP                                                      ->54
   37    42    >   INIT_FCALL                                               'str_pad'
         43        INIT_FCALL                                               'substr'
         44        SEND_VAR                                                 !8
         45        SEND_VAL                                                 0
         46        SEND_VAL                                                 3
         47        DO_ICALL                                         $33     
         48        SEND_VAR                                                 $33
         49        SEND_VAL                                                 6
         50        SEND_VAL                                                 '+'
         51        SEND_VAL                                                 0
         52        DO_ICALL                                         $34     
         53        QM_ASSIGN                                        ~32     $34
         54    >   ECHO                                                     ~32
   33    55      > JMP                                                      ->19
         56    >   FE_FREE                                                  $24
   40    57      > FE_RESET_R                                       $35     !2, ->107
         58    > > FE_FETCH_R                                       ~36     $35, !7, ->107
         59    >   ASSIGN                                                   !8, ~36
   41    60        INIT_FCALL                                               'substr'
         61        SEND_VAR                                                 !8
         62        SEND_VAL                                                 0
         63        SEND_VAL                                                 3
         64        DO_ICALL                                         $38     
         65        CONCAT                                           ~39     '%0A', $38
         66        ECHO                                                     ~39
   42    67      > FE_RESET_R                                       $40     !7, ->105
         68    > > FE_FETCH_R                                       ~41     $40, !9, ->105
         69    >   ASSIGN                                                   !10, ~41
   43    70        INIT_FCALL                                               'reset'
         71        SEND_REF                                                 !7
         72        DO_ICALL                                                 
   44    73        INIT_FCALL                                               'key'
         74        SEND_VAR                                                 !7
         75        DO_ICALL                                         $44     
         76        IS_IDENTICAL                                             !10, $44
         77      > JMPZ                                                     ~45, ->91
   45    78    >   INIT_FCALL                                               'str_pad'
         79        INIT_FCALL                                               'substr'
         80        SEND_VAR                                                 !9
         81        SEND_VAL                                                 0
         82        SEND_VAL                                                 3
         83        DO_ICALL                                         $46     
         84        SEND_VAR                                                 $46
         85        SEND_VAL                                                 4
         86        SEND_VAL                                                 '+'
         87        SEND_VAL                                                 0
         88        DO_ICALL                                         $47     
         89        QM_ASSIGN                                        ~48     $47
         90      > JMP                                                      ->103
   46    91    >   INIT_FCALL                                               'str_pad'
         92        INIT_FCALL                                               'substr'
         93        SEND_VAR                                                 !9
         94        SEND_VAL                                                 0
         95        SEND_VAL                                                 3
         96        DO_ICALL                                         $49     
         97        SEND_VAR                                                 $49
         98        SEND_VAL                                                 6
         99        SEND_VAL                                                 '+'
        100        SEND_VAL                                                 0
        101        DO_ICALL                                         $50     
        102        QM_ASSIGN                                        ~48     $50
        103    >   ECHO                                                     ~48
   42   104      > JMP                                                      ->68
        105    >   FE_FREE                                                  $40
   40   106      > JMP                                                      ->58
        107    >   FE_FREE                                                  $35
   49   108      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.42 ms | 1404 KiB | 21 Q