3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo set_markup(10001); function set_markup($total_price) { $total_price = (int)$total_price; switch($total_price) { case ($total_price >= 0 && $total_price <= 9999): $markup_percent = 25; break; case ($total_price >= 10000 && $total_price <= 25000): $markup_percent = 20; break; case ($total_price >= 25001 && $total_price <= 99999): $markup_percent = 15; break; case ($total_price >= 100000 && $total_price <= 999999): $markup_percent = 10; break; case ($total_price >= 1000000 && $total_price <= 20000000): $markup_percent = 5; break; default: $markup_percent = 0; break; } return $markup_percent; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rp471
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL_BY_NAME                                       'set_markup'
          1        SEND_VAL_EX                                              10001
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
   26     4      > RETURN                                                   1

Function set_markup:
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 = 44) Position 1 = 9, Position 2 = 34
Branch analysis from position: 9
2 jumps found. (Code = 46) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 15, Position 2 = 36
Branch analysis from position: 15
2 jumps found. (Code = 46) Position 1 = 17, Position 2 = 19
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 38
Branch analysis from position: 21
2 jumps found. (Code = 46) Position 1 = 23, Position 2 = 25
Branch analysis from position: 23
2 jumps found. (Code = 44) Position 1 = 27, Position 2 = 40
Branch analysis from position: 27
2 jumps found. (Code = 46) Position 1 = 29, Position 2 = 31
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 42
Branch analysis from position: 33
1 jumps found. (Code = 42) Position 1 = 44
Branch analysis from position: 44
1 jumps found. (Code = 42) Position 1 = 46
Branch analysis from position: 46
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 42
1 jumps found. (Code = 42) Position 1 = 46
Branch analysis from position: 46
Branch analysis from position: 31
Branch analysis from position: 40
1 jumps found. (Code = 42) Position 1 = 46
Branch analysis from position: 46
Branch analysis from position: 25
Branch analysis from position: 38
1 jumps found. (Code = 42) Position 1 = 46
Branch analysis from position: 46
Branch analysis from position: 19
Branch analysis from position: 36
1 jumps found. (Code = 42) Position 1 = 46
Branch analysis from position: 46
Branch analysis from position: 13
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 46
Branch analysis from position: 46
Branch analysis from position: 7
filename:       /in/rp471
function name:  set_markup
number of ops:  48
compiled vars:  !0 = $total_price, !1 = $markup_percent
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        CAST                                          4  ~2      !0
          2        ASSIGN                                                   !0, ~2
    6     3        IS_SMALLER_OR_EQUAL                              ~5      0, !0
          4      > JMPZ_EX                                          ~5      ~5, ->7
          5    >   IS_SMALLER_OR_EQUAL                              ~6      !0, 9999
          6        BOOL                                             ~5      ~6
          7    >   IS_EQUAL                                                 !0, ~5
          8      > JMPNZ                                                    ~4, ->34
    9     9    >   IS_SMALLER_OR_EQUAL                              ~7      10000, !0
         10      > JMPZ_EX                                          ~7      ~7, ->13
         11    >   IS_SMALLER_OR_EQUAL                              ~8      !0, 25000
         12        BOOL                                             ~7      ~8
         13    >   IS_EQUAL                                                 !0, ~7
         14      > JMPNZ                                                    ~4, ->36
   12    15    >   IS_SMALLER_OR_EQUAL                              ~9      25001, !0
         16      > JMPZ_EX                                          ~9      ~9, ->19
         17    >   IS_SMALLER_OR_EQUAL                              ~10     !0, 99999
         18        BOOL                                             ~9      ~10
         19    >   IS_EQUAL                                                 !0, ~9
         20      > JMPNZ                                                    ~4, ->38
   15    21    >   IS_SMALLER_OR_EQUAL                              ~11     100000, !0
         22      > JMPZ_EX                                          ~11     ~11, ->25
         23    >   IS_SMALLER_OR_EQUAL                              ~12     !0, 999999
         24        BOOL                                             ~11     ~12
         25    >   IS_EQUAL                                                 !0, ~11
         26      > JMPNZ                                                    ~4, ->40
   18    27    >   IS_SMALLER_OR_EQUAL                              ~13     1000000, !0
         28      > JMPZ_EX                                          ~13     ~13, ->31
         29    >   IS_SMALLER_OR_EQUAL                              ~14     !0, 20000000
         30        BOOL                                             ~13     ~14
         31    >   IS_EQUAL                                                 !0, ~13
         32      > JMPNZ                                                    ~4, ->42
         33    > > JMP                                                      ->44
    7    34    >   ASSIGN                                                   !1, 25
    8    35      > JMP                                                      ->46
   10    36    >   ASSIGN                                                   !1, 20
   11    37      > JMP                                                      ->46
   13    38    >   ASSIGN                                                   !1, 15
   14    39      > JMP                                                      ->46
   16    40    >   ASSIGN                                                   !1, 10
   17    41      > JMP                                                      ->46
   19    42    >   ASSIGN                                                   !1, 5
   20    43      > JMP                                                      ->46
   22    44    >   ASSIGN                                                   !1, 0
   23    45      > JMP                                                      ->46
   25    46    > > RETURN                                                   !1
   26    47*     > RETURN                                                   null

End of function set_markup

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.37 ms | 1399 KiB | 13 Q