3v4l.org

run code in 300+ PHP versions simultaneously
<?php function get_user_level( $user_point ) { switch (true) { case $user_point >= 3000: return 5; case $user_point >= 2000: return 4; case $user_point >= 1500: return 3; case $user_point >= 1000: return 2; case $user_point >= 500: return 1; default: return 0; } } echo get_user_level(3515);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TmiAH
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   INIT_FCALL                                               'get_user_level'
          1        SEND_VAL                                                 3515
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function get_user_level:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 44) Position 1 = 3, Position 2 = 12
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 5, Position 2 = 13
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 7, Position 2 = 14
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 9, Position 2 = 15
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 16
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TmiAH
function name:  get_user_level
number of ops:  19
compiled vars:  !0 = $user_point
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    6     1        IS_SMALLER_OR_EQUAL                                      3000, !0
          2      > JMPNZ                                                    ~2, ->12
    8     3    >   IS_SMALLER_OR_EQUAL                                      2000, !0
          4      > JMPNZ                                                    ~3, ->13
   10     5    >   IS_SMALLER_OR_EQUAL                                      1500, !0
          6      > JMPNZ                                                    ~4, ->14
   12     7    >   IS_SMALLER_OR_EQUAL                                      1000, !0
          8      > JMPNZ                                                    ~5, ->15
   14     9    >   IS_SMALLER_OR_EQUAL                                      500, !0
         10      > JMPNZ                                                    ~6, ->16
         11    > > JMP                                                      ->17
    7    12    > > RETURN                                                   5
    9    13    > > RETURN                                                   4
   11    14    > > RETURN                                                   3
   13    15    > > RETURN                                                   2
   15    16    > > RETURN                                                   1
   17    17    > > RETURN                                                   0
   19    18*     > RETURN                                                   null

End of function get_user_level

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.05 ms | 1012 KiB | 14 Q