3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getGrade($score) { switch (true) { case $score > 90: return "A"; case $score > 80: return "B"; case $score > 70: return "C"; default: return "F"; } } echo getGrade(85);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OUVWl
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'getgrade'
          1        SEND_VAL                                                 85
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function getgrade:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 44) Position 1 = 3, Position 2 = 8
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 5, Position 2 = 9
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 7, Position 2 = 10
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OUVWl
function name:  getGrade
number of ops:  13
compiled vars:  !0 = $score
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    6     1        IS_SMALLER                                               90, !0
          2      > JMPNZ                                                    ~2, ->8
    7     3    >   IS_SMALLER                                               80, !0
          4      > JMPNZ                                                    ~3, ->9
    8     5    >   IS_SMALLER                                               70, !0
          6      > JMPNZ                                                    ~4, ->10
          7    > > JMP                                                      ->11
    6     8    > > RETURN                                                   'A'
    7     9    > > RETURN                                                   'B'
    8    10    > > RETURN                                                   'C'
    9    11    > > RETURN                                                   'F'
   11    12*     > RETURN                                                   null

End of function getgrade

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
207.43 ms | 1001 KiB | 14 Q