3v4l.org

run code in 300+ PHP versions simultaneously
<?php $do_excel = 1; $visual_na = '-'; $visual_taken = 'X'; $visual_required = 'R'; $employee_header = 'Employee'; $hire_date_header = 'Hire Date'; $percentage_header = 'Percentage of Required Complete'; $header_array = array($employee_header, $hire_date_header, $percentage_header); if(isset($_REQUEST['by'])) $split_by = strtolower($_REQUEST['by']); //department, manager, or undefined for single sheet //sorting algorithm function cmp_class($a, $b) { switch($a){ case $GLOBALS['employee_header']: return -1; case $GLOBALS['hire_date_header']: if($b == $GLOBALS['employee_header']) return 1; return -1; case $GLOBALS['percentage_header']: return 1; default: if($b == $GLOBALS['employee_header'] or $b == $GLOBALS['hire_date_header']) return 1; return $a > $b; } } //split function, to simplify getting a sheet where splits exists or a default sheet where it doesn't function getSheet($row_data){ if(isset($GLOBALS['split_by'])) return $row_data[$GLOBALS['split_by']]; return 'Sheet1'; } if(isset($_GET['form']) && $_GET['form'] == 'old'){$visual_na='N'; $visual_taken='X'; $visual_required=' ';}?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 20
Branch analysis from position: 14
2 jumps found. (Code = 46) Position 1 = 23, Position 2 = 27
Branch analysis from position: 23
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 31
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
Branch analysis from position: 27
Branch analysis from position: 20
filename:       /in/ShN70
function name:  (null)
number of ops:  32
compiled vars:  !0 = $do_excel, !1 = $visual_na, !2 = $visual_taken, !3 = $visual_required, !4 = $employee_header, !5 = $hire_date_header, !6 = $percentage_header, !7 = $header_array, !8 = $split_by
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 1
    4     1        ASSIGN                                                   !1, '-'
    5     2        ASSIGN                                                   !2, 'X'
    6     3        ASSIGN                                                   !3, 'R'
    8     4        ASSIGN                                                   !4, 'Employee'
    9     5        ASSIGN                                                   !5, 'Hire+Date'
   10     6        ASSIGN                                                   !6, 'Percentage+of+Required+Complete'
   11     7        INIT_ARRAY                                       ~16     !4
          8        ADD_ARRAY_ELEMENT                                ~16     !5
          9        ADD_ARRAY_ELEMENT                                ~16     !6
         10        ASSIGN                                                   !7, ~16
   12    11        FETCH_IS                                         ~18     '_REQUEST'
         12        ISSET_ISEMPTY_DIM_OBJ                         0          ~18, 'by'
         13      > JMPZ                                                     ~19, ->20
   13    14    >   INIT_FCALL                                               'strtolower'
         15        FETCH_R                      global              ~20     '_REQUEST'
         16        FETCH_DIM_R                                      ~21     ~20, 'by'
         17        SEND_VAL                                                 ~21
         18        DO_ICALL                                         $22     
         19        ASSIGN                                                   !8, $22
   40    20    >   FETCH_IS                                         ~24     '_GET'
         21        ISSET_ISEMPTY_DIM_OBJ                         0  ~25     ~24, 'form'
         22      > JMPZ_EX                                          ~25     ~25, ->27
         23    >   FETCH_R                      global              ~26     '_GET'
         24        FETCH_DIM_R                                      ~27     ~26, 'form'
         25        IS_EQUAL                                         ~28     ~27, 'old'
         26        BOOL                                             ~25     ~28
         27    > > JMPZ                                                     ~25, ->31
         28    >   ASSIGN                                                   !1, 'N'
         29        ASSIGN                                                   !2, 'X'
         30        ASSIGN                                                   !3, '+'
         31    > > RETURN                                                   1

Function cmp_class:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 44) Position 1 = 6, Position 2 = 15
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 16
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 22
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
2 jumps found. (Code = 47) Position 1 = 27, Position 2 = 31
Branch analysis from position: 27
2 jumps found. (Code = 43) Position 1 = 32, Position 2 = 33
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 21
Branch analysis from position: 20
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: 15
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ShN70
function name:  cmp_class
number of ops:  36
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   18     2        FETCH_R                      global              ~3      'GLOBALS'
          3        FETCH_DIM_R                                      ~4      ~3, 'employee_header'
          4        IS_EQUAL                                                 !0, ~4
          5      > JMPNZ                                                    ~2, ->15
   20     6    >   FETCH_R                      global              ~5      'GLOBALS'
          7        FETCH_DIM_R                                      ~6      ~5, 'hire_date_header'
          8        IS_EQUAL                                                 !0, ~6
          9      > JMPNZ                                                    ~2, ->16
   24    10    >   FETCH_R                      global              ~7      'GLOBALS'
         11        FETCH_DIM_R                                      ~8      ~7, 'percentage_header'
         12        IS_EQUAL                                                 !0, ~8
         13      > JMPNZ                                                    ~2, ->22
         14    > > JMP                                                      ->23
   19    15    > > RETURN                                                   -1
   21    16    >   FETCH_R                      global              ~9      'GLOBALS'
         17        FETCH_DIM_R                                      ~10     ~9, 'employee_header'
         18        IS_EQUAL                                                 !1, ~10
         19      > JMPZ                                                     ~11, ->21
   22    20    > > RETURN                                                   1
   23    21    > > RETURN                                                   -1
   25    22    > > RETURN                                                   1
   27    23    >   FETCH_R                      global              ~12     'GLOBALS'
         24        FETCH_DIM_R                                      ~13     ~12, 'employee_header'
         25        IS_EQUAL                                         ~14     !1, ~13
         26      > JMPNZ_EX                                         ~14     ~14, ->31
         27    >   FETCH_R                      global              ~15     'GLOBALS'
         28        FETCH_DIM_R                                      ~16     ~15, 'hire_date_header'
         29        IS_EQUAL                                         ~17     !1, ~16
         30        BOOL                                             ~14     ~17
         31    > > JMPZ                                                     ~14, ->33
   28    32    > > RETURN                                                   1
   29    33    >   IS_SMALLER                                       ~18     !1, !0
         34      > RETURN                                                   ~18
   31    35*     > RETURN                                                   null

End of function cmp_class

Function getsheet:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 8
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ShN70
function name:  getSheet
number of ops:  10
compiled vars:  !0 = $row_data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   34     0  E >   RECV                                             !0      
   35     1        FETCH_IS                                         ~1      'GLOBALS'
          2        ISSET_ISEMPTY_DIM_OBJ                         0          ~1, 'split_by'
          3      > JMPZ                                                     ~2, ->8
   36     4    >   FETCH_R                      global              ~3      'GLOBALS'
          5        FETCH_DIM_R                                      ~4      ~3, 'split_by'
          6        FETCH_DIM_R                                      ~5      !0, ~4
          7      > RETURN                                                   ~5
   37     8    > > RETURN                                                   'Sheet1'
   38     9*     > RETURN                                                   null

End of function getsheet

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.19 ms | 1404 KiB | 15 Q