3v4l.org

run code in 300+ PHP versions simultaneously
<?php $var; function connectToDB($string) { return false; } switch (false) { // check if we have DB credentials. case isset($DBcredentials): $DBcredentials = 'myawesomepassword';; echo "Setting var" . PHP_EOL; // connect to DB. case connectToDB($DBcredentials): // 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 = 9
Branch analysis from position: 2
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 11
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 13
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
filename:       /in/8R1uu
function name:  (null)
number of ops:  22
compiled vars:  !0 = $var, !1 = $DBcredentials
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ISSET_ISEMPTY_CV                                         !1
          1      > JMPZ                                                     ~3, ->9
   14     2    >   INIT_FCALL                                               'connecttodb'
          3        SEND_VAR                                                 !1
          4        DO_FCALL                                      0  $4      
          5      > JMPZ                                                     $4, ->11
   19     6    >   TYPE_CHECK                                   64          !0
          7      > JMPZ                                                     ~5, ->13
          8    > > JMP                                                      ->17
   10     9    >   ASSIGN                                                   !1, 'myawesomepassword'
   11    10        ECHO                                                     'Setting+var%0A'
   16    11    >   ASSIGN                                                   !0, 1
   17    12        ECHO                                                     'Truthing+Var%0A'
   21    13    >   CAST                                          6  ~8      !0
         14        ASSIGN                                                   !0, ~8
   22    15        ECHO                                                     'Stringing+var%0A'
   23    16      > JMP                                                      ->18
   28    17    >   ECHO                                                     'All+checks+passed%21'
   31    18    >   INIT_FCALL                                               'var_dump'
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Function connecttodb:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8R1uu
function name:  connectToDB
number of ops:  3
compiled vars:  !0 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1      > RETURN                                                   <false>
          2*     > RETURN                                                   null

End of function connecttodb

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.33 ms | 1399 KiB | 16 Q