3v4l.org

run code in 500+ PHP versions simultaneously
<?php class DemoBugSessionHandler implements SessionHandlerInterface { public function open($save_path, $name) { return true; } /** * Read session data * @link https://php.net/manual/en/sessionhandlerinterface.read.php * @param string $session_id The session id to read data for. * @return string <p> * Returns an encoded string of the read data. * If nothing was read, it must return an empty string. * Note this value is returned internally to PHP for processing. * </p> * @since 5.4.0 */ public function read($session_id) { // Simulate a session ID regeneration. \session_id('newsessionid'); return ''; } /** * Write session data * @link https://php.net/manual/en/sessionhandlerinterface.write.php * @param string $session_id The session id. * @param string $session_data <p> * The encoded session data. This data is the * result of the PHP internally encoding * the $_SESSION superglobal to a serialized * string and passing it as this parameter. * Please note sessions use an alternative serialization method. * </p> * @return bool <p> * The return value (usually TRUE on success, FALSE on failure). * Note this value is returned internally to PHP for processing. * </p> * @since 5.4.0 */ public function write($session_id, $session_data) { // Print back to the user agent the $session_id // that is going to be persisted when the script finishes. echo $session_id . PHP_EOL; return true; } public function destroy($session_id) { return true; } public function close() { return true; } public function gc($maxlifetime) { return true; } } ini_set('session.use_strict_mode', '1'); session_set_save_handler(new \DemoBugSessionHandler(), true); session_start(); echo ini_get('session.use_strict_mode') . PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pfKge
function name:  (null)
number of ops:  19
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                                'demobugsessionhandler'
   72     1        INIT_FCALL                                                   'ini_set'
          2        SEND_VAL                                                     'session.use_strict_mode'
          3        SEND_VAL                                                     '1'
          4        DO_ICALL                                                     
   74     5        INIT_FCALL                                                   'session_set_save_handler'
          6        NEW                                                  $1      'DemoBugSessionHandler'
          7        DO_FCALL                                          0          
          8        SEND_VAR                                                     $1
          9        SEND_VAL                                                     <true>
         10        DO_ICALL                                                     
   76    11        INIT_FCALL                                                   'session_start'
         12        DO_ICALL                                                     
   78    13        INIT_FCALL                                                   'ini_get'
         14        SEND_VAL                                                     'session.use_strict_mode'
         15        DO_ICALL                                             $5      
         16        CONCAT                                               ~6      $5, '%0A'
         17        ECHO                                                         ~6
   79    18      > RETURN                                                       1

Class DemoBugSessionHandler:
Function open:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pfKge
function name:  open
number of ops:  4
compiled vars:  !0 = $save_path, !1 = $name
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
    7     2      > RETURN                                                       <true>
    8     3*     > RETURN                                                       null

End of function open

Function read:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pfKge
function name:  read
number of ops:  6
compiled vars:  !0 = $session_id
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   21     0  E >   RECV                                                 !0      
   24     1        INIT_FCALL                                                   'session_id'
          2        SEND_VAL                                                     'newsessionid'
          3        DO_ICALL                                                     
   26     4      > RETURN                                                       ''
   27     5*     > RETURN                                                       null

End of function read

Function write:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pfKge
function name:  write
number of ops:  6
compiled vars:  !0 = $session_id, !1 = $session_data
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   46     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
   51     2        CONCAT                                               ~2      !0, '%0A'
          3        ECHO                                                         ~2
   53     4      > RETURN                                                       <true>
   54     5*     > RETURN                                                       null

End of function write

Function destroy:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pfKge
function name:  destroy
number of ops:  3
compiled vars:  !0 = $session_id
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   56     0  E >   RECV                                                 !0      
   58     1      > RETURN                                                       <true>
   59     2*     > RETURN                                                       null

End of function destroy

Function close:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pfKge
function name:  close
number of ops:  2
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   63     0  E > > RETURN                                                       <true>
   64     1*     > RETURN                                                       null

End of function close

Function gc:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pfKge
function name:  gc
number of ops:  3
compiled vars:  !0 = $maxlifetime
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   66     0  E >   RECV                                                 !0      
   68     1      > RETURN                                                       <true>
   69     2*     > RETURN                                                       null

End of function gc

End of class DemoBugSessionHandler.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
179.77 ms | 2468 KiB | 18 Q