3v4l.org

run code in 300+ PHP versions simultaneously
<?php $foo = 1; switch($bar=++$foo) { case ($bar == 2): echo "horse"; break; case ($foo == 1): echo "hammer"; break; default: echo "wat"; break; } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 44) Position 1 = 6, Position 2 = 10
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 9, Position 2 = 12
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
filename:       /in/QbNhu
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 >   ASSIGN                                                   !0, 1
    3     1        PRE_INC                                          ~3      !0
          2        ASSIGN                                           ~4      !1, ~3
    4     3        IS_EQUAL                                         ~6      !1, 2
          4        CASE                                                     ~4, ~6
          5      > JMPNZ                                                    ~5, ->10
    7     6    >   IS_EQUAL                                         ~7      !0, 1
          7        CASE                                                     ~4, ~7
          8      > JMPNZ                                                    ~5, ->12
          9    > > JMP                                                      ->14
    5    10    >   ECHO                                                     'horse'
    6    11      > JMP                                                      ->16
    8    12    >   ECHO                                                     'hammer'
    9    13      > JMP                                                      ->16
   11    14    >   ECHO                                                     'wat'
   12    15      > JMP                                                      ->16
         16    >   FREE                                                     ~4
   14    17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.96 ms | 1394 KiB | 13 Q