3v4l.org

run code in 300+ PHP versions simultaneously
<? switch(true){ case ($foo == 1): case ($bar == "horse"): $foo = 2; $bar = "hammer"; break; case ($foo == 2): case ($bar == "hammer"): $foo = "horse"; $bar = "horse"; break; default: $foo = $bar; break; } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 44) Position 1 = 2, Position 2 = 9
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 = 12
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 12
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
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: 12
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 12
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 9
filename:       /in/f9t5L
function name:  (null)
number of ops:  18
compiled vars:  !0 = $foo, !1 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   IS_EQUAL                                                 !0, 1
          1      > JMPNZ                                                    ~3, ->9
    3     2    >   IS_EQUAL                                                 !1, 'horse'
          3      > JMPNZ                                                    ~4, ->9
    7     4    >   IS_EQUAL                                                 !0, 2
          5      > JMPNZ                                                    ~5, ->12
    8     6    >   IS_EQUAL                                                 !1, 'hammer'
          7      > JMPNZ                                                    ~6, ->12
          8    > > JMP                                                      ->15
    4     9    >   ASSIGN                                                   !0, 2
    5    10        ASSIGN                                                   !1, 'hammer'
    6    11      > JMP                                                      ->17
    9    12    >   ASSIGN                                                   !0, 'horse'
   10    13        ASSIGN                                                   !1, 'horse'
   11    14      > JMP                                                      ->17
   13    15    >   ASSIGN                                                   !0, !1
   14    16      > JMP                                                      ->17
   16    17    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.27 ms | 1398 KiB | 13 Q