3v4l.org

run code in 300+ PHP versions simultaneously
<?php $var = 123; switch (false) { case isset($var): throw new Exception("Not set!"); case $var: throw new Exception("False!"); case is_string($var): throw new Exception("Not a string!"); /* case customGuardFunction() */ default: echo "All checks passed!"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 11
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 15
Branch analysis from position: 6
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: 15
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/19dao
function name:  (null)
number of ops:  21
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 123
    6     1        ISSET_ISEMPTY_CV                                         !0
          2      > JMPZ                                                     ~3, ->7
    8     3    > > JMPZ                                                     !0, ->11
   10     4    >   TYPE_CHECK                                   64          !0
          5      > JMPZ                                                     ~4, ->15
          6    > > JMP                                                      ->19
    7     7    >   NEW                                              $5      'Exception'
          8        SEND_VAL_EX                                              'Not+set%21'
          9        DO_FCALL                                      0          
         10      > THROW                                         0          $5
    9    11    >   NEW                                              $7      'Exception'
         12        SEND_VAL_EX                                              'False%21'
         13        DO_FCALL                                      0          
         14      > THROW                                         0          $7
   11    15    >   NEW                                              $9      'Exception'
         16        SEND_VAL_EX                                              'Not+a+string%21'
         17        DO_FCALL                                      0          
         18      > THROW                                         0          $9
   14    19    >   ECHO                                                     'All+checks+passed%21'
   15    20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.65 ms | 1385 KiB | 13 Q