3v4l.org

run code in 300+ PHP versions simultaneously
<?php class SessionSaveHandler { public function __construct() { session_set_save_handler( array($this, "open"), array($this, "close"), array($this, "read"), array($this, "write"), array($this, "destroy"), array($this, "gc") ); register_shutdown_function('session_write_close'); } public function open($savePath, $sessionName) { return true; } public function close() { return true; } public function read($id) { global $memcachedConnection; return $memcachedConnection->get($id); } public function write($id, $data) { global $memcachedConnection; $memcachedConnection->set($id, $data, 3600); } public function destroy($id) { global $memcachedConnection; $memcachedConnection->delete($id); return true; } public function gc($maxlifetime) { return true; } } $sessionHandler = new SessionSaveHandler();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IcUMB
function name:  (null)
number of ops:  4
compiled vars:  !0 = $sessionHandler
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   58     0  E >   NEW                                              $1      'SessionSaveHandler'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
          3      > RETURN                                                   1

Class SessionSaveHandler:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IcUMB
function name:  __construct
number of ops:  30
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'session_set_save_handler'
    8     1        FETCH_THIS                                       ~0      
          2        INIT_ARRAY                                       ~1      ~0
          3        ADD_ARRAY_ELEMENT                                ~1      'open'
          4        SEND_VAL                                                 ~1
    9     5        FETCH_THIS                                       ~2      
          6        INIT_ARRAY                                       ~3      ~2
          7        ADD_ARRAY_ELEMENT                                ~3      'close'
          8        SEND_VAL                                                 ~3
   10     9        FETCH_THIS                                       ~4      
         10        INIT_ARRAY                                       ~5      ~4
         11        ADD_ARRAY_ELEMENT                                ~5      'read'
         12        SEND_VAL                                                 ~5
   11    13        FETCH_THIS                                       ~6      
         14        INIT_ARRAY                                       ~7      ~6
         15        ADD_ARRAY_ELEMENT                                ~7      'write'
         16        SEND_VAL                                                 ~7
   12    17        FETCH_THIS                                       ~8      
         18        INIT_ARRAY                                       ~9      ~8
         19        ADD_ARRAY_ELEMENT                                ~9      'destroy'
         20        SEND_VAL                                                 ~9
   13    21        FETCH_THIS                                       ~10     
         22        INIT_ARRAY                                       ~11     ~10
         23        ADD_ARRAY_ELEMENT                                ~11     'gc'
         24        SEND_VAL                                                 ~11
         25        DO_ICALL                                                 
   16    26        INIT_FCALL                                               'register_shutdown_function'
         27        SEND_VAL                                                 'session_write_close'
         28        DO_ICALL                                                 
   17    29      > RETURN                                                   null

End of function __construct

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

End of function open

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

End of function close

Function read:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IcUMB
function name:  read
number of ops:  7
compiled vars:  !0 = $id, !1 = $memcachedConnection
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   RECV                                             !0      
   31     1        BIND_GLOBAL                                              !1, 'memcachedConnection'
   33     2        INIT_METHOD_CALL                                         !1, 'get'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0  $2      
          5      > RETURN                                                   $2
   34     6*     > 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/IcUMB
function name:  write
number of ops:  9
compiled vars:  !0 = $id, !1 = $data, !2 = $memcachedConnection
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   36     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   38     2        BIND_GLOBAL                                              !2, 'memcachedConnection'
   40     3        INIT_METHOD_CALL                                         !2, 'set'
          4        SEND_VAR_EX                                              !0
          5        SEND_VAR_EX                                              !1
          6        SEND_VAL_EX                                              3600
          7        DO_FCALL                                      0          
   41     8      > 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/IcUMB
function name:  destroy
number of ops:  7
compiled vars:  !0 = $id, !1 = $memcachedConnection
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   43     0  E >   RECV                                             !0      
   45     1        BIND_GLOBAL                                              !1, 'memcachedConnection'
   47     2        INIT_METHOD_CALL                                         !1, 'delete'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0          
   49     5      > RETURN                                                   <true>
   50     6*     > RETURN                                                   null

End of function destroy

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

End of function gc

End of class SessionSaveHandler.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.64 ms | 1396 KiB | 17 Q