3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.44 ms | 939 KiB | 14 Q