3v4l.org

run code in 300+ 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; } } session_set_save_handler(new \DemoBugSessionHandler(), true); session_start();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6S4XM
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'demobugsessionhandler'
   72     1        INIT_FCALL                                               'session_set_save_handler'
          2        NEW                                              $0      'DemoBugSessionHandler'
          3        DO_FCALL                                      0          
          4        SEND_VAR                                                 $0
          5        SEND_VAL                                                 <true>
          6        DO_ICALL                                                 
   74     7        INIT_FCALL                                               'session_start'
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Class DemoBugSessionHandler:
Function open:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6S4XM
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/6S4XM
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/6S4XM
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/6S4XM
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/6S4XM
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/6S4XM
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.0.0


preferences:
164.35 ms | 945 KiB | 20 Q