3v4l.org

run code in 300+ PHP versions simultaneously
<?php $headers = array("A", "B", "C"); function calcExcelHeader($idx) { var_dump($headers); $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/2uQZq
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>
   17     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 = 9
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 6
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 6
Branch analysis from position: 14
Branch analysis from position: 6
filename:       /in/2uQZq
function name:  calcExcelHeader
number of ops:  18
compiled vars:  !0 = $idx, !1 = $headers, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !1
          3        DO_ICALL                                                 
    8     4        ASSIGN                                                   !2, 0
    9     5      > JMP                                                      ->9
   10     6    >   COUNT                                            ~5      !1
          7        ASSIGN_OP                                     2          !0, ~5
   11     8        PRE_INC                                                  !2
    9     9    >   COUNT                                            ~8      !1
         10        MOD                                              ~9      !0, ~8
         11        COUNT                                            ~10     !1
         12        IS_SMALLER_OR_EQUAL                                      ~10, ~9
         13      > JMPNZ                                                    ~11, ->6
   14    14    >   CONCAT                                           ~12     !0, '+%2B+'
         15        CONCAT                                           ~13     ~12, !2
         16      > RETURN                                                   ~13
   15    17*     > RETURN                                                   null

End of function calcexcelheader

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.26 ms | 1399 KiB | 16 Q