3v4l.org

run code in 300+ PHP versions simultaneously
<?php 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/TtkiX
function name:  (null)
number of ops:  18
compiled vars:  !0 = $foo, !1 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   IS_EQUAL                                                 !0, 1
          1      > JMPNZ                                                    ~3, ->9
    5     2    >   IS_EQUAL                                                 !1, 'horse'
          3      > JMPNZ                                                    ~4, ->9
    9     4    >   IS_EQUAL                                                 !0, 2
          5      > JMPNZ                                                    ~5, ->12
   10     6    >   IS_EQUAL                                                 !1, 'hammer'
          7      > JMPNZ                                                    ~6, ->12
          8    > > JMP                                                      ->15
    6     9    >   ASSIGN                                                   !0, 2
    7    10        ASSIGN                                                   !1, 'hammer'
    8    11      > JMP                                                      ->17
   11    12    >   ASSIGN                                                   !0, 'horse'
   12    13        ASSIGN                                                   !1, 'horse'
   13    14      > JMP                                                      ->17
   15    15    >   ASSIGN                                                   !0, !1
   16    16      > JMP                                                      ->17
   18    17    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.53 ms | 1394 KiB | 13 Q