3v4l.org

run code in 300+ PHP versions simultaneously
<?php $value = 81; $edge_cases = ['C','A']; $category = ''; if($value > 40 && $value <= 50){ $category = 'BC'; }else if($value > 50 && $value <= 70){ $category = 'B'; }else if($value > 70 && $value <= 80){ $category = 'AB'; }else{ $quotient = intval($value / 80); $index = abs(intval($quotient / (($quotient - 1) | 1))); $category = $edge_cases[$index]; } echo $category;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 10
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 37
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
2 jumps found. (Code = 46) Position 1 = 12, Position 2 = 14
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 17
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 37
Branch analysis from position: 37
Branch analysis from position: 17
2 jumps found. (Code = 46) Position 1 = 19, Position 2 = 21
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 24
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 37
Branch analysis from position: 37
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
Branch analysis from position: 14
Branch analysis from position: 7
filename:       /in/78S4p
function name:  (null)
number of ops:  39
compiled vars:  !0 = $value, !1 = $edge_cases, !2 = $category, !3 = $quotient, !4 = $index
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 81
    4     1        ASSIGN                                                   !1, <array>
    6     2        ASSIGN                                                   !2, ''
    8     3        IS_SMALLER                                       ~8      40, !0
          4      > JMPZ_EX                                          ~8      ~8, ->7
          5    >   IS_SMALLER_OR_EQUAL                              ~9      !0, 50
          6        BOOL                                             ~8      ~9
          7    > > JMPZ                                                     ~8, ->10
    9     8    >   ASSIGN                                                   !2, 'BC'
    8     9      > JMP                                                      ->37
   10    10    >   IS_SMALLER                                       ~11     50, !0
         11      > JMPZ_EX                                          ~11     ~11, ->14
         12    >   IS_SMALLER_OR_EQUAL                              ~12     !0, 70
         13        BOOL                                             ~11     ~12
         14    > > JMPZ                                                     ~11, ->17
   11    15    >   ASSIGN                                                   !2, 'B'
   10    16      > JMP                                                      ->37
   12    17    >   IS_SMALLER                                       ~14     70, !0
         18      > JMPZ_EX                                          ~14     ~14, ->21
         19    >   IS_SMALLER_OR_EQUAL                              ~15     !0, 80
         20        BOOL                                             ~14     ~15
         21    > > JMPZ                                                     ~14, ->24
   13    22    >   ASSIGN                                                   !2, 'AB'
   12    23      > JMP                                                      ->37
   15    24    >   DIV                                              ~17     !0, 80
         25        CAST                                          4  ~18     ~17
         26        ASSIGN                                                   !3, ~18
   16    27        INIT_FCALL                                               'abs'
         28        SUB                                              ~20     !3, 1
         29        BW_OR                                            ~21     ~20, 1
         30        DIV                                              ~22     !3, ~21
         31        CAST                                          4  ~23     ~22
         32        SEND_VAL                                                 ~23
         33        DO_ICALL                                         $24     
         34        ASSIGN                                                   !4, $24
   17    35        FETCH_DIM_R                                      ~26     !1, !4
         36        ASSIGN                                                   !2, ~26
   20    37    >   ECHO                                                     !2
   21    38      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
281.3 ms | 1015 KiB | 14 Q