3v4l.org

run code in 300+ PHP versions simultaneously
<?php $map = [ 6 => 215601, 11 => 3260461, 7 => 210282, 11 => 3258941 ]; foreach($map as $key => $value) { $p = str_pad($key, 3, '0', STR_PAD_LEFT) . str_pad($value, 10, '0', STR_PAD_LEFT); echo "\n"; echo $p; $ctr = 22; $ctro = '0' . substr($p,1,2) . substr($p,6); echo "\n"; echo $ctro; for ($i=0; $i <= 8; $i+=2) { $ctr = $ctr + 3*(int)substr($ctro,$i,1) + (int)substr($ctro,(1+$i),1); } echo "\n"; echo $ctr; $ctr = (10 - ($ctr % 10)) % 10; echo "\n"; echo "Key = " . $ctr; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 67
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 67
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 55
Branch analysis from position: 55
2 jumps found. (Code = 44) Position 1 = 57, Position 2 = 37
Branch analysis from position: 57
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 37
2 jumps found. (Code = 44) Position 1 = 57, Position 2 = 37
Branch analysis from position: 57
Branch analysis from position: 37
Branch analysis from position: 67
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 67
filename:       /in/DgeWl
function name:  (null)
number of ops:  69
compiled vars:  !0 = $map, !1 = $value, !2 = $key, !3 = $p, !4 = $ctr, !5 = $ctro, !6 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   11     1      > FE_RESET_R                                       $8      !0, ->67
          2    > > FE_FETCH_R                                       ~9      $8, !1, ->67
          3    >   ASSIGN                                                   !2, ~9
   12     4        INIT_FCALL                                               'str_pad'
          5        SEND_VAR                                                 !2
          6        SEND_VAL                                                 3
          7        SEND_VAL                                                 '0'
          8        SEND_VAL                                                 0
          9        DO_ICALL                                         $11     
         10        INIT_FCALL                                               'str_pad'
         11        SEND_VAR                                                 !1
         12        SEND_VAL                                                 10
         13        SEND_VAL                                                 '0'
         14        SEND_VAL                                                 0
         15        DO_ICALL                                         $12     
         16        CONCAT                                           ~13     $11, $12
         17        ASSIGN                                                   !3, ~13
   14    18        ECHO                                                     '%0A'
   15    19        ECHO                                                     !3
   17    20        ASSIGN                                                   !4, 22
   18    21        INIT_FCALL                                               'substr'
         22        SEND_VAR                                                 !3
         23        SEND_VAL                                                 1
         24        SEND_VAL                                                 2
         25        DO_ICALL                                         $16     
         26        CONCAT                                           ~17     '0', $16
         27        INIT_FCALL                                               'substr'
         28        SEND_VAR                                                 !3
         29        SEND_VAL                                                 6
         30        DO_ICALL                                         $18     
         31        CONCAT                                           ~19     ~17, $18
         32        ASSIGN                                                   !5, ~19
   20    33        ECHO                                                     '%0A'
   21    34        ECHO                                                     !5
   23    35        ASSIGN                                                   !6, 0
         36      > JMP                                                      ->55
   24    37    >   INIT_FCALL                                               'substr'
         38        SEND_VAR                                                 !5
         39        SEND_VAR                                                 !6
         40        SEND_VAL                                                 1
         41        DO_ICALL                                         $22     
         42        CAST                                          4  ~23     $22
         43        MUL                                              ~24     ~23, 3
         44        ADD                                              ~25     !4, ~24
         45        INIT_FCALL                                               'substr'
         46        SEND_VAR                                                 !5
         47        ADD                                              ~26     1, !6
         48        SEND_VAL                                                 ~26
         49        SEND_VAL                                                 1
         50        DO_ICALL                                         $27     
         51        CAST                                          4  ~28     $27
         52        ADD                                              ~29     ~25, ~28
         53        ASSIGN                                                   !4, ~29
   23    54        ASSIGN_OP                                     1          !6, 2
         55    >   IS_SMALLER_OR_EQUAL                                      !6, 8
         56      > JMPNZ                                                    ~32, ->37
   27    57    >   ECHO                                                     '%0A'
   28    58        ECHO                                                     !4
   30    59        MOD                                              ~33     !4, 10
         60        SUB                                              ~34     10, ~33
         61        MOD                                              ~35     ~34, 10
         62        ASSIGN                                                   !4, ~35
   32    63        ECHO                                                     '%0A'
   33    64        CONCAT                                           ~37     'Key+%3D+', !4
         65        ECHO                                                     ~37
   11    66      > JMP                                                      ->2
         67    >   FE_FREE                                                  $8
   34    68      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
178.85 ms | 1400 KiB | 17 Q