3v4l.org

run code in 300+ PHP versions simultaneously
<?php session_start(); // if the user navigates directly to session.php and there is NOT an active session with stored session variables, redirect to input.php if ((!isset($_SESSION["username"]) && !isset($_SESSION["s1"]) && !isset($_SESSION["s2"]) && !isset($_SESSION["firstrun"])) ) { //&& empty($_REQUEST["username"] && empty($_REQUEST["s1"]) && empty($_REQUEST["username"])) { header("Location: input.php"); exit; } // if the user navigates directly to session.php and there IS an active session with stored variables, redirect to strings.php but // ONLY if input.php did NOT call session.php with POST data else if (isset($_SESSION["username"]) && isset($_SESSION["s1"]) && isset($_SESSION["s2"]) && ($_SESSION["username"] != "") && ($_SESSION["s1"] != "") && ($_SESSION["s2"] != "") && ($_SESSION["firstrun"] == "false") && empty($_POST)) { header("Location: strings.php"); exit; } else { if (!empty($_REQUEST)) { $username = htmlspecialchars($_REQUEST["username"]); $s1 = htmlspecialchars($_REQUEST["s1"]); $s2 = htmlspecialchars($_REQUEST["s2"]); if ($username != "" && $s1 != "" && $s2 != "") { $_SESSION["username"] = $username; // implicit call to session_start() if not already called $_SESSION["s1"] = $s1; // call session_name() first to start named session $_SESSION["s2"] = $s2; //echo "Vars are".$_SESSION["username"].$_SESSION["s1"].$_SESSION["s2"]; // if session creation and variable assigning was successful, set firstrun to false and empty the POST array // return true to calling JS function to enable redirect to strings.php if (isset($_SESSION["username"]) && isset($_SESSION["s1"]) && isset($_SESSION["s2"])) { $_SESSION["firstrun"] = "false"; $_POST = array(); echo "true"; } } } } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 6, Position 2 = 10
Branch analysis from position: 6
2 jumps found. (Code = 46) Position 1 = 11, Position 2 = 15
Branch analysis from position: 11
2 jumps found. (Code = 46) Position 1 = 16, Position 2 = 20
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 26
Branch analysis from position: 21
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 26
2 jumps found. (Code = 46) Position 1 = 29, Position 2 = 32
Branch analysis from position: 29
2 jumps found. (Code = 46) Position 1 = 33, Position 2 = 36
Branch analysis from position: 33
2 jumps found. (Code = 46) Position 1 = 37, Position 2 = 41
Branch analysis from position: 37
2 jumps found. (Code = 46) Position 1 = 42, Position 2 = 46
Branch analysis from position: 42
2 jumps found. (Code = 46) Position 1 = 47, Position 2 = 51
Branch analysis from position: 47
2 jumps found. (Code = 46) Position 1 = 52, Position 2 = 56
Branch analysis from position: 52
2 jumps found. (Code = 46) Position 1 = 57, Position 2 = 59
Branch analysis from position: 57
2 jumps found. (Code = 43) Position 1 = 60, Position 2 = 65
Branch analysis from position: 60
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 65
2 jumps found. (Code = 43) Position 1 = 68, Position 2 = 120
Branch analysis from position: 68
2 jumps found. (Code = 46) Position 1 = 88, Position 2 = 90
Branch analysis from position: 88
2 jumps found. (Code = 46) Position 1 = 91, Position 2 = 93
Branch analysis from position: 91
2 jumps found. (Code = 43) Position 1 = 94, Position 2 = 120
Branch analysis from position: 94
2 jumps found. (Code = 46) Position 1 = 106, Position 2 = 109
Branch analysis from position: 106
2 jumps found. (Code = 46) Position 1 = 110, Position 2 = 113
Branch analysis from position: 110
2 jumps found. (Code = 43) Position 1 = 114, Position 2 = 120
Branch analysis from position: 114
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 120
Branch analysis from position: 113
Branch analysis from position: 109
Branch analysis from position: 120
Branch analysis from position: 93
Branch analysis from position: 90
Branch analysis from position: 120
Branch analysis from position: 59
Branch analysis from position: 56
Branch analysis from position: 51
Branch analysis from position: 46
Branch analysis from position: 41
Branch analysis from position: 36
Branch analysis from position: 32
Branch analysis from position: 20
Branch analysis from position: 15
Branch analysis from position: 10
filename:       /in/0kEfI
function name:  (null)
number of ops:  121
compiled vars:  !0 = $username, !1 = $s1, !2 = $s2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'session_start'
          1        DO_ICALL                                                 
    7     2        FETCH_IS                                         ~4      '_SESSION'
          3        ISSET_ISEMPTY_DIM_OBJ                         0  ~5      ~4, 'username'
          4        BOOL_NOT                                         ~6      ~5
          5      > JMPZ_EX                                          ~6      ~6, ->10
          6    >   FETCH_IS                                         ~7      '_SESSION'
          7        ISSET_ISEMPTY_DIM_OBJ                         0  ~8      ~7, 's1'
          8        BOOL_NOT                                         ~9      ~8
          9        BOOL                                             ~6      ~9
         10    > > JMPZ_EX                                          ~6      ~6, ->15
         11    >   FETCH_IS                                         ~10     '_SESSION'
         12        ISSET_ISEMPTY_DIM_OBJ                         0  ~11     ~10, 's2'
         13        BOOL_NOT                                         ~12     ~11
         14        BOOL                                             ~6      ~12
         15    > > JMPZ_EX                                          ~6      ~6, ->20
         16    >   FETCH_IS                                         ~13     '_SESSION'
         17        ISSET_ISEMPTY_DIM_OBJ                         0  ~14     ~13, 'firstrun'
         18        BOOL_NOT                                         ~15     ~14
         19        BOOL                                             ~6      ~15
         20    > > JMPZ                                                     ~6, ->26
    9    21    >   INIT_FCALL                                               'header'
         22        SEND_VAL                                                 'Location%3A+input.php'
         23        DO_ICALL                                                 
   10    24      > EXIT                                                     
         25*       JMP                                                      ->120
   15    26    >   FETCH_IS                                         ~17     '_SESSION'
         27        ISSET_ISEMPTY_DIM_OBJ                         0  ~18     ~17, 'username'
         28      > JMPZ_EX                                          ~18     ~18, ->32
         29    >   FETCH_IS                                         ~19     '_SESSION'
         30        ISSET_ISEMPTY_DIM_OBJ                         0  ~20     ~19, 's1'
         31        BOOL                                             ~18     ~20
         32    > > JMPZ_EX                                          ~18     ~18, ->36
         33    >   FETCH_IS                                         ~21     '_SESSION'
         34        ISSET_ISEMPTY_DIM_OBJ                         0  ~22     ~21, 's2'
         35        BOOL                                             ~18     ~22
         36    > > JMPZ_EX                                          ~18     ~18, ->41
         37    >   FETCH_R                      global              ~23     '_SESSION'
         38        FETCH_DIM_R                                      ~24     ~23, 'username'
         39        IS_NOT_EQUAL                                     ~25     ~24, ''
         40        BOOL                                             ~18     ~25
         41    > > JMPZ_EX                                          ~18     ~18, ->46
   16    42    >   FETCH_R                      global              ~26     '_SESSION'
         43        FETCH_DIM_R                                      ~27     ~26, 's1'
         44        IS_NOT_EQUAL                                     ~28     ~27, ''
         45        BOOL                                             ~18     ~28
         46    > > JMPZ_EX                                          ~18     ~18, ->51
         47    >   FETCH_R                      global              ~29     '_SESSION'
         48        FETCH_DIM_R                                      ~30     ~29, 's2'
         49        IS_NOT_EQUAL                                     ~31     ~30, ''
         50        BOOL                                             ~18     ~31
         51    > > JMPZ_EX                                          ~18     ~18, ->56
         52    >   FETCH_R                      global              ~32     '_SESSION'
         53        FETCH_DIM_R                                      ~33     ~32, 'firstrun'
         54        IS_EQUAL                                         ~34     ~33, 'false'
         55        BOOL                                             ~18     ~34
         56    > > JMPZ_EX                                          ~18     ~18, ->59
   17    57    >   ISSET_ISEMPTY_VAR                             3  ~35     '_POST'
         58        BOOL                                             ~18     ~35
         59    > > JMPZ                                                     ~18, ->65
   18    60    >   INIT_FCALL                                               'header'
         61        SEND_VAL                                                 'Location%3A+strings.php'
         62        DO_ICALL                                                 
   19    63      > EXIT                                                     
         64*       JMP                                                      ->120
   24    65    >   ISSET_ISEMPTY_VAR                             3  ~37     '_REQUEST'
         66        BOOL_NOT                                         ~38     ~37
         67      > JMPZ                                                     ~38, ->120
   28    68    >   INIT_FCALL                                               'htmlspecialchars'
         69        FETCH_R                      global              ~39     '_REQUEST'
         70        FETCH_DIM_R                                      ~40     ~39, 'username'
         71        SEND_VAL                                                 ~40
         72        DO_ICALL                                         $41     
         73        ASSIGN                                                   !0, $41
   29    74        INIT_FCALL                                               'htmlspecialchars'
         75        FETCH_R                      global              ~43     '_REQUEST'
         76        FETCH_DIM_R                                      ~44     ~43, 's1'
         77        SEND_VAL                                                 ~44
         78        DO_ICALL                                         $45     
         79        ASSIGN                                                   !1, $45
   30    80        INIT_FCALL                                               'htmlspecialchars'
         81        FETCH_R                      global              ~47     '_REQUEST'
         82        FETCH_DIM_R                                      ~48     ~47, 's2'
         83        SEND_VAL                                                 ~48
         84        DO_ICALL                                         $49     
         85        ASSIGN                                                   !2, $49
   34    86        IS_NOT_EQUAL                                     ~51     !0, ''
         87      > JMPZ_EX                                          ~51     ~51, ->90
         88    >   IS_NOT_EQUAL                                     ~52     !1, ''
         89        BOOL                                             ~51     ~52
         90    > > JMPZ_EX                                          ~51     ~51, ->93
         91    >   IS_NOT_EQUAL                                     ~53     !2, ''
         92        BOOL                                             ~51     ~53
         93    > > JMPZ                                                     ~51, ->120
   35    94    >   FETCH_W                      global              $54     '_SESSION'
         95        ASSIGN_DIM                                               $54, 'username'
         96        OP_DATA                                                  !0
   36    97        FETCH_W                      global              $56     '_SESSION'
         98        ASSIGN_DIM                                               $56, 's1'
         99        OP_DATA                                                  !1
   37   100        FETCH_W                      global              $58     '_SESSION'
        101        ASSIGN_DIM                                               $58, 's2'
        102        OP_DATA                                                  !2
   43   103        FETCH_IS                                         ~60     '_SESSION'
        104        ISSET_ISEMPTY_DIM_OBJ                         0  ~61     ~60, 'username'
        105      > JMPZ_EX                                          ~61     ~61, ->109
        106    >   FETCH_IS                                         ~62     '_SESSION'
        107        ISSET_ISEMPTY_DIM_OBJ                         0  ~63     ~62, 's1'
        108        BOOL                                             ~61     ~63
        109    > > JMPZ_EX                                          ~61     ~61, ->113
        110    >   FETCH_IS                                         ~64     '_SESSION'
        111        ISSET_ISEMPTY_DIM_OBJ                         0  ~65     ~64, 's2'
        112        BOOL                                             ~61     ~65
        113    > > JMPZ                                                     ~61, ->120
   44   114    >   FETCH_W                      global              $66     '_SESSION'
        115        ASSIGN_DIM                                               $66, 'firstrun'
        116        OP_DATA                                                  'false'
   45   117        FETCH_W                      global              $68     '_POST'
        118        ASSIGN                                                   $68, <array>
   46   119        ECHO                                                     'true'
   65   120    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.07 ms | 1408 KiB | 19 Q