3v4l.org

run code in 300+ PHP versions simultaneously
<?php $headers = array("A", "B", "C"); function calcExcelHeader($idx) { $i = 0; while ($idx % count($headers) >= count($headers)) { $idx -= count($headers); $i++; } return $idx . " + " . $i; } echo calcExcelHeader(3);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DI0in
function name:  (null)
number of ops:  6
compiled vars:  !0 = $headers
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   15     1        INIT_FCALL                                               'calcexcelheader'
          2        SEND_VAL                                                 3
          3        DO_FCALL                                      0  $2      
          4        ECHO                                                     $2
          5      > RETURN                                                   1

Function calcexcelheader:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 3
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 3
Branch analysis from position: 11
Branch analysis from position: 3
filename:       /in/DI0in
function name:  calcExcelHeader
number of ops:  15
compiled vars:  !0 = $idx, !1 = $i, !2 = $headers
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        ASSIGN                                                   !1, 0
    7     2      > JMP                                                      ->6
    8     3    >   COUNT                                            ~4      !2
          4        ASSIGN_OP                                     2          !0, ~4
    9     5        PRE_INC                                                  !1
    7     6    >   COUNT                                            ~7      !2
          7        MOD                                              ~8      !0, ~7
          8        COUNT                                            ~9      !2
          9        IS_SMALLER_OR_EQUAL                                      ~9, ~8
         10      > JMPNZ                                                    ~10, ->3
   12    11    >   CONCAT                                           ~11     !0, '+%2B+'
         12        CONCAT                                           ~12     ~11, !1
         13      > RETURN                                                   ~12
   13    14*     > RETURN                                                   null

End of function calcexcelheader

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.4 ms | 1402 KiB | 14 Q