3v4l.org

run code in 300+ PHP versions simultaneously
<?php session_start(); function startSes() { $_SESSION['registered'][0] = 0; $_SESSION['registered'][1] = 0; } if (!isset($_SESSION['registered'])) startSes(); if ($_SESSION['registered'][0] == 0) { echo "Came here!<br />"; $_SESSION['registered'][0] = 1; } // later if (!isset($_SESSION['registered'])) startSes(); if ($_SESSION['registered'][0] == 0) { echo "Came here!<br />"; $_SESSION['registered'][0] = 1; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 18
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 24
Branch analysis from position: 22
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 34
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 34
Branch analysis from position: 24
Branch analysis from position: 18
Branch analysis from position: 8
filename:       /in/EC28S
function name:  (null)
number of ops:  35
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'session_start'
          1        DO_ICALL                                                 
    8     2        FETCH_IS                                         ~1      '_SESSION'
          3        ISSET_ISEMPTY_DIM_OBJ                         0  ~2      ~1, 'registered'
          4        BOOL_NOT                                         ~3      ~2
          5      > JMPZ                                                     ~3, ->8
    9     6    >   INIT_FCALL                                               'startses'
          7        DO_FCALL                                      0          
   11     8    >   FETCH_R                      global              ~5      '_SESSION'
          9        FETCH_DIM_R                                      ~6      ~5, 'registered'
         10        FETCH_DIM_R                                      ~7      ~6, 0
         11        IS_EQUAL                                                 ~7, 0
         12      > JMPZ                                                     ~8, ->18
   13    13    >   ECHO                                                     'Came+here%21%3Cbr+%2F%3E'
   14    14        FETCH_W                      global              $9      '_SESSION'
         15        FETCH_DIM_W                                      $10     $9, 'registered'
         16        ASSIGN_DIM                                               $10, 0
         17        OP_DATA                                                  1
   19    18    >   FETCH_IS                                         ~12     '_SESSION'
         19        ISSET_ISEMPTY_DIM_OBJ                         0  ~13     ~12, 'registered'
         20        BOOL_NOT                                         ~14     ~13
         21      > JMPZ                                                     ~14, ->24
   20    22    >   INIT_FCALL                                               'startses'
         23        DO_FCALL                                      0          
   22    24    >   FETCH_R                      global              ~16     '_SESSION'
         25        FETCH_DIM_R                                      ~17     ~16, 'registered'
         26        FETCH_DIM_R                                      ~18     ~17, 0
         27        IS_EQUAL                                                 ~18, 0
         28      > JMPZ                                                     ~19, ->34
   24    29    >   ECHO                                                     'Came+here%21%3Cbr+%2F%3E'
   25    30        FETCH_W                      global              $20     '_SESSION'
         31        FETCH_DIM_W                                      $21     $20, 'registered'
         32        ASSIGN_DIM                                               $21, 0
         33        OP_DATA                                                  1
   26    34    > > RETURN                                                   1

Function startses:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EC28S
function name:  startSes
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   FETCH_W                      global              $0      '_SESSION'
          1        FETCH_DIM_W                                      $1      $0, 'registered'
          2        ASSIGN_DIM                                               $1, 0
          3        OP_DATA                                                  0
    6     4        FETCH_W                      global              $3      '_SESSION'
          5        FETCH_DIM_W                                      $4      $3, 'registered'
          6        ASSIGN_DIM                                               $4, 1
          7        OP_DATA                                                  0
    7     8      > RETURN                                                   null

End of function startses

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.87 ms | 1403 KiB | 17 Q