3v4l.org

run code in 500+ PHP versions simultaneously
<?php $comparedNumber = 1.2549999999; if (0 < $comparedNumber && round($comparedNumber, 2) <= round(1.25,2)) { $selectedRange = 'Range 1'; } elseif ( round(1.26,2) <= round($comparedNumber, 2) && round($comparedNumber, 2) <= round(2.45,2)) { $selectedRange = 'Range 2'; } elseif ( round(2.46,2) <= round($comparedNumber, 2) && round($comparedNumber, 2) <= round(5,2)) { $selectedRange = 'Range 3'; } elseif ( round(5.01,2) <= round($comparedNumber, 2) ) { $selectedRange = 'Range 4'; } else { $selectedRange = 'Range not exist'; } print_r($selectedRange);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 3, Position 2 = 13
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 16
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 75
Branch analysis from position: 75
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
2 jumps found. (Code = 46) Position 1 = 26, Position 2 = 36
Branch analysis from position: 26
2 jumps found. (Code = 43) Position 1 = 37, Position 2 = 39
Branch analysis from position: 37
1 jumps found. (Code = 42) Position 1 = 75
Branch analysis from position: 75
Branch analysis from position: 39
2 jumps found. (Code = 46) Position 1 = 49, Position 2 = 59
Branch analysis from position: 49
2 jumps found. (Code = 43) Position 1 = 60, Position 2 = 62
Branch analysis from position: 60
1 jumps found. (Code = 42) Position 1 = 75
Branch analysis from position: 75
Branch analysis from position: 62
2 jumps found. (Code = 43) Position 1 = 72, Position 2 = 74
Branch analysis from position: 72
1 jumps found. (Code = 42) Position 1 = 75
Branch analysis from position: 75
Branch analysis from position: 74
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 59
Branch analysis from position: 36
Branch analysis from position: 13
filename:       /in/CDGoo
function name:  (null)
number of ops:  79
compiled vars:  !0 = $comparedNumber, !1 = $selectedRange
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, 1.255
    4     1        IS_SMALLER                                           ~3      0, !0
          2      > JMPZ_EX                                              ~3      ~3, ->13
          3    >   INIT_FCALL                                                   'round'
          4        SEND_VAR                                                     !0
          5        SEND_VAL                                                     2
          6        DO_ICALL                                             $4      
          7        INIT_FCALL                                                   'round'
          8        SEND_VAL                                                     1.25
          9        SEND_VAL                                                     2
         10        DO_ICALL                                             $5      
         11        IS_SMALLER_OR_EQUAL                                  ~6      $4, $5
         12        BOOL                                                 ~3      ~6
         13    > > JMPZ                                                         ~3, ->16
    5    14    >   ASSIGN                                                       !1, 'Range+1'
    4    15      > JMP                                                          ->75
    6    16    >   INIT_FCALL                                                   'round'
         17        SEND_VAL                                                     1.26
         18        SEND_VAL                                                     2
         19        DO_ICALL                                             $8      
         20        INIT_FCALL                                                   'round'
         21        SEND_VAR                                                     !0
         22        SEND_VAL                                                     2
         23        DO_ICALL                                             $9      
         24        IS_SMALLER_OR_EQUAL                                  ~10     $8, $9
         25      > JMPZ_EX                                              ~10     ~10, ->36
         26    >   INIT_FCALL                                                   'round'
         27        SEND_VAR                                                     !0
         28        SEND_VAL                                                     2
         29        DO_ICALL                                             $11     
         30        INIT_FCALL                                                   'round'
         31        SEND_VAL                                                     2.45
         32        SEND_VAL                                                     2
         33        DO_ICALL                                             $12     
         34        IS_SMALLER_OR_EQUAL                                  ~13     $11, $12
         35        BOOL                                                 ~10     ~13
         36    > > JMPZ                                                         ~10, ->39
    7    37    >   ASSIGN                                                       !1, 'Range+2'
    6    38      > JMP                                                          ->75
    8    39    >   INIT_FCALL                                                   'round'
         40        SEND_VAL                                                     2.46
         41        SEND_VAL                                                     2
         42        DO_ICALL                                             $15     
         43        INIT_FCALL                                                   'round'
         44        SEND_VAR                                                     !0
         45        SEND_VAL                                                     2
         46        DO_ICALL                                             $16     
         47        IS_SMALLER_OR_EQUAL                                  ~17     $15, $16
         48      > JMPZ_EX                                              ~17     ~17, ->59
         49    >   INIT_FCALL                                                   'round'
         50        SEND_VAR                                                     !0
         51        SEND_VAL                                                     2
         52        DO_ICALL                                             $18     
         53        INIT_FCALL                                                   'round'
         54        SEND_VAL                                                     5
         55        SEND_VAL                                                     2
         56        DO_ICALL                                             $19     
         57        IS_SMALLER_OR_EQUAL                                  ~20     $18, $19
         58        BOOL                                                 ~17     ~20
         59    > > JMPZ                                                         ~17, ->62
    9    60    >   ASSIGN                                                       !1, 'Range+3'
    8    61      > JMP                                                          ->75
   10    62    >   INIT_FCALL                                                   'round'
         63        SEND_VAL                                                     5.01
         64        SEND_VAL                                                     2
         65        DO_ICALL                                             $22     
         66        INIT_FCALL                                                   'round'
         67        SEND_VAR                                                     !0
         68        SEND_VAL                                                     2
         69        DO_ICALL                                             $23     
         70        IS_SMALLER_OR_EQUAL                                          $22, $23
         71      > JMPZ                                                         ~24, ->74
   11    72    >   ASSIGN                                                       !1, 'Range+4'
   10    73      > JMP                                                          ->75
   13    74    >   ASSIGN                                                       !1, 'Range+not+exist'
   16    75    >   INIT_FCALL                                                   'print_r'
         76        SEND_VAR                                                     !1
         77        DO_ICALL                                                     
         78      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
163.24 ms | 1888 KiB | 15 Q