3v4l.org

run code in 300+ PHP versions simultaneously
<?php $KEY_BASE = str_split("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"); $BASE = 62; $num = '11112887'; //$num = intval($num); //$num = array_map('intval',str_split($num)); $result = ''; $remainder = 0; foreach ($num as $digit) { $remainder = $digit%$BASE; echo 'remainder '.$remainder; echo 'key remainder '.$KEY_BASE[$remainder]; $result.=$KEY_BASE[$remainder]; //echo $digit; } //echo $result; echo base_convert($num,'0123456789','0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ');
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 20
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 20
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/rTdf1
function name:  (null)
number of ops:  28
compiled vars:  !0 = $KEY_BASE, !1 = $BASE, !2 = $num, !3 = $result, !4 = $remainder, !5 = $digit
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'str_split'
          1        SEND_VAL                                                 '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
          2        DO_ICALL                                         $6      
          3        ASSIGN                                                   !0, $6
    4     4        ASSIGN                                                   !1, 62
    5     5        ASSIGN                                                   !2, '11112887'
    8     6        ASSIGN                                                   !3, ''
    9     7        ASSIGN                                                   !4, 0
   10     8      > FE_RESET_R                                       $12     !2, ->20
          9    > > FE_FETCH_R                                               $12, !5, ->20
   11    10    >   MOD                                              ~13     !5, !1
         11        ASSIGN                                                   !4, ~13
   12    12        CONCAT                                           ~15     'remainder+', !4
         13        ECHO                                                     ~15
   13    14        FETCH_DIM_R                                      ~16     !0, !4
         15        CONCAT                                           ~17     'key+remainder+', ~16
         16        ECHO                                                     ~17
   14    17        FETCH_DIM_R                                      ~18     !0, !4
         18        ASSIGN_OP                                     8          !3, ~18
   10    19      > JMP                                                      ->9
         20    >   FE_FREE                                                  $12
   18    21        INIT_FCALL                                               'base_convert'
         22        SEND_VAR                                                 !2
         23        SEND_VAL                                                 '0123456789'
         24        SEND_VAL                                                 '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
         25        DO_ICALL                                         $20     
         26        ECHO                                                     $20
         27      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.82 ms | 1396 KiB | 17 Q