3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.86 ms | 1394 KiB | 13 Q