3v4l.org

run code in 300+ PHP versions simultaneously
<?php $favcolor="blue"; switch ($favcolor) { case "red": echo "Your favorite color is red!"; case "blue": echo "Your favorite color is blue!"; case "green": echo "Your favorite color is green!"; default: echo "Your favorite color is neither red, blue, or green!"; } ?>
Finding entry points
Branch analysis from position: 0
5 jumps found. (Code = 188) Position 1 = 9, Position 2 = 10, Position 3 = 11, Position 4 = 12, Position 5 = 2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
Branch analysis from position: 11
Branch analysis from position: 12
Branch analysis from position: 2
2 jumps found. (Code = 44) Position 1 = 4, Position 2 = 9
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 6, Position 2 = 10
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 11
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 11
Branch analysis from position: 10
Branch analysis from position: 9
filename:       /in/HA995
function name:  (null)
number of ops:  14
compiled vars:  !0 = $favcolor
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'blue'
    3     1      > SWITCH_STRING                                            !0, [ 'red':->9, 'blue':->10, 'green':->11, ], ->12
    5     2    >   IS_EQUAL                                                 !0, 'red'
          3      > JMPNZ                                                    ~2, ->9
    8     4    >   IS_EQUAL                                                 !0, 'blue'
          5      > JMPNZ                                                    ~2, ->10
   11     6    >   IS_EQUAL                                                 !0, 'green'
          7      > JMPNZ                                                    ~2, ->11
          8    > > JMP                                                      ->12
    6     9    >   ECHO                                                     'Your+favorite+color+is+red%21'
    9    10    >   ECHO                                                     'Your+favorite+color+is+blue%21'
   12    11    >   ECHO                                                     'Your+favorite+color+is+green%21'
   15    12    >   ECHO                                                     'Your+favorite+color+is+neither+red%2C+blue%2C+or+green%21'
   17    13      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.36 ms | 1393 KiB | 13 Q