3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.15 ms | 1394 KiB | 15 Q