3v4l.org

run code in 300+ PHP versions simultaneously
<?php $colLetter = ''; $colLetter = function($num) use(&$colLetter) { $letters=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'); //if the number is greater than 26, calculate to get the next letters if($num > 26) { //divide the number by 26 and get rid of the decimal $comp = floor($num / 26); //add the letter to the end of the result and return it if ($comp != 0) { // don't subtract 1 if the comparative variable is greater than 0 return $colLetter($comp) . $letters[($num - $comp * 26)]; } else { return $colLetter($comp) . $letters[($num - $comp * 26) - 1]; } } return $letters[($num-1)]; }; $colLetter(1); $colLetter(2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gm17f
function name:  (null)
number of ops:  11
compiled vars:  !0 = $colLetter
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, ''
    4     1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fgm17f%3A4%240'
          2        BIND_LEXICAL                                             ~2, !0
          3        ASSIGN                                                   !0, ~2
   23     4        INIT_DYNAMIC_CALL                                        !0
          5        SEND_VAL_EX                                              1
          6        DO_FCALL                                      0          
   24     7        INIT_DYNAMIC_CALL                                        !0
          8        SEND_VAL_EX                                              2
          9        DO_FCALL                                      0          
         10      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Fgm17f%3A4%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 30
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 21
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gm17f
function name:  {closure}
number of ops:  34
compiled vars:  !0 = $num, !1 = $colLetter, !2 = $letters, !3 = $comp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
    5     2        ASSIGN                                                   !2, <array>
    8     3        IS_SMALLER                                               26, !0
          4      > JMPZ                                                     ~5, ->30
   10     5    >   INIT_FCALL                                               'floor'
          6        DIV                                              ~6      !0, 26
          7        SEND_VAL                                                 ~6
          8        DO_ICALL                                         $7      
          9        ASSIGN                                                   !3, $7
   13    10        IS_NOT_EQUAL                                             !3, 0
         11      > JMPZ                                                     ~9, ->21
   15    12    >   INIT_DYNAMIC_CALL                                        !1
         13        SEND_VAR_EX                                              !3
         14        DO_FCALL                                      0  $10     
         15        MUL                                              ~11     !3, 26
         16        SUB                                              ~12     !0, ~11
         17        FETCH_DIM_R                                      ~13     !2, ~12
         18        CONCAT                                           ~14     $10, ~13
         19      > RETURN                                                   ~14
         20*       JMP                                                      ->30
   17    21    >   INIT_DYNAMIC_CALL                                        !1
         22        SEND_VAR_EX                                              !3
         23        DO_FCALL                                      0  $15     
         24        MUL                                              ~16     !3, 26
         25        SUB                                              ~17     !0, ~16
         26        SUB                                              ~18     ~17, 1
         27        FETCH_DIM_R                                      ~19     !2, ~18
         28        CONCAT                                           ~20     $15, ~19
         29      > RETURN                                                   ~20
   20    30    >   SUB                                              ~21     !0, 1
         31        FETCH_DIM_R                                      ~22     !2, ~21
         32      > RETURN                                                   ~22
   21    33*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fgm17f%3A4%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.05 ms | 1400 KiB | 15 Q