3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.1 ms | 1394 KiB | 13 Q