3v4l.org

run code in 300+ PHP versions simultaneously
<?php function toNum($data) { $alphabet = array( 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' ); $alpha_flip = array_flip($alphabet); $return_value = -1; $length = strlen($data); for ($i = 0; $i < $length; $i++) { $return_value += ($alpha_flip[$data[$i]] + 1) * pow(26, ($length - $i - 1)); } return $return_value; } ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sdbeH
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E > > RETURN                                                   1

Function tonum:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 11
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 11
Branch analysis from position: 25
Branch analysis from position: 11
filename:       /in/sdbeH
function name:  toNum
number of ops:  27
compiled vars:  !0 = $data, !1 = $alphabet, !2 = $alpha_flip, !3 = $return_value, !4 = $length, !5 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        ASSIGN                                                   !1, <array>
   10     2        INIT_FCALL                                               'array_flip'
          3        SEND_VAR                                                 !1
          4        DO_ICALL                                         $7      
          5        ASSIGN                                                   !2, $7
   11     6        ASSIGN                                                   !3, -1
   12     7        STRLEN                                           ~10     !0
          8        ASSIGN                                                   !4, ~10
   13     9        ASSIGN                                                   !5, 0
         10      > JMP                                                      ->23
   15    11    >   FETCH_DIM_R                                      ~13     !0, !5
         12        FETCH_DIM_R                                      ~14     !2, ~13
         13        ADD                                              ~15     ~14, 1
         14        INIT_FCALL                                               'pow'
         15        SEND_VAL                                                 26
         16        SUB                                              ~16     !4, !5
         17        SUB                                              ~17     ~16, 1
         18        SEND_VAL                                                 ~17
         19        DO_ICALL                                         $18     
         20        MUL                                              ~19     $18, ~15
         21        ASSIGN_OP                                     1          !3, ~19
   13    22        PRE_INC                                                  !5
         23    >   IS_SMALLER                                               !5, !4
         24      > JMPNZ                                                    ~22, ->11
   17    25    > > RETURN                                                   !3
   18    26*     > RETURN                                                   null

End of function tonum

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.69 ms | 1400 KiB | 17 Q