3v4l.org

run code in 300+ PHP versions simultaneously
<?php $var; switch (false) { case isset($var): $var = ''; echo "Setting var" . PHP_EOL; case $var: // delberiate fall through, case $var is *not* caught, but we end here anyways. $var = 1; echo "Truthing Var" . PHP_EOL; case is_string($var): // delebirate fall through, case is_string($var) is *not* caught, but we end here anyways. $var = (string) $var; echo "Stringing var" . PHP_EOL; break; /* case customGuardFunction() */ default: echo "All checks passed!"; } var_dump($var);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 6
Branch analysis from position: 2
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 8
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 10
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
filename:       /in/rAMRi
function name:  (null)
number of ops:  19
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   ISSET_ISEMPTY_CV                                         !0
          1      > JMPZ                                                     ~2, ->6
   10     2    > > JMPZ                                                     !0, ->8
   15     3    >   TYPE_CHECK                                   64          !0
          4      > JMPZ                                                     ~3, ->10
          5    > > JMP                                                      ->14
    7     6    >   ASSIGN                                                   !0, ''
    8     7        ECHO                                                     'Setting+var%0A'
   12     8    >   ASSIGN                                                   !0, 1
   13     9        ECHO                                                     'Truthing+Var%0A'
   17    10    >   CAST                                          6  ~6      !0
         11        ASSIGN                                                   !0, ~6
   18    12        ECHO                                                     'Stringing+var%0A'
   19    13      > JMP                                                      ->15
   24    14    >   ECHO                                                     'All+checks+passed%21'
   27    15    >   INIT_FCALL                                               'var_dump'
         16        SEND_VAR                                                 !0
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
178.12 ms | 1395 KiB | 15 Q