3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MySessionHandler implements \SessionHandlerInterface { public function open($savePath, $sessionName) { echo 'open ' . $sessionName . "\n"; } public function close() { echo 'close' . "\n"; } public function read($id) { echo 'read ' . $id . "\n"; } public function write($id, $data) { echo 'write ' . $id . ': ' . $data . "\n"; } public function destroy($id) { echo 'destroy ' . $id . "\n"; } public function gc($maxlifetime) { echo 'gc ' . $maxlifetime . "\n"; } } $handler = new MySessionHandler(); session_set_save_handler($handler, true); session_start(); $_SESSION['foo'] = 'bar'; echo session_id(); session_regenerate_id(); echo session_id(); session_destroy(); session_start(); session_write_close();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OjiOn
function name:  (null)
number of ops:  28
compiled vars:  !0 = $handler
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   DECLARE_CLASS                                            'mysessionhandler'
   38     1        NEW                                              $1      'MySessionHandler'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   39     4        INIT_FCALL                                               'session_set_save_handler'
          5        SEND_VAR                                                 !0
          6        SEND_VAL                                                 <true>
          7        DO_ICALL                                                 
   40     8        INIT_FCALL                                               'session_start'
          9        DO_ICALL                                                 
   42    10        FETCH_W                      global              $6      '_SESSION'
         11        ASSIGN_DIM                                               $6, 'foo'
         12        OP_DATA                                                  'bar'
   44    13        INIT_FCALL                                               'session_id'
         14        DO_ICALL                                         $8      
         15        ECHO                                                     $8
   45    16        INIT_FCALL                                               'session_regenerate_id'
         17        DO_ICALL                                                 
   46    18        INIT_FCALL                                               'session_id'
         19        DO_ICALL                                         $10     
         20        ECHO                                                     $10
   47    21        INIT_FCALL                                               'session_destroy'
         22        DO_ICALL                                                 
   49    23        INIT_FCALL                                               'session_start'
         24        DO_ICALL                                                 
   50    25        INIT_FCALL                                               'session_write_close'
         26        DO_ICALL                                                 
         27      > RETURN                                                   1

Class MySessionHandler:
Function open:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OjiOn
function name:  open
number of ops:  6
compiled vars:  !0 = $savePath, !1 = $sessionName
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    9     2        CONCAT                                           ~2      'open+', !1
          3        CONCAT                                           ~3      ~2, '%0A'
          4        ECHO                                                     ~3
   10     5      > 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/OjiOn
function name:  close
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   ECHO                                                     'close%0A'
   15     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/OjiOn
function name:  read
number of ops:  5
compiled vars:  !0 = $id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   19     1        CONCAT                                           ~1      'read+', !0
          2        CONCAT                                           ~2      ~1, '%0A'
          3        ECHO                                                     ~2
   20     4      > 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/OjiOn
function name:  write
number of ops:  8
compiled vars:  !0 = $id, !1 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   24     2        CONCAT                                           ~2      'write+', !0
          3        CONCAT                                           ~3      ~2, '%3A+'
          4        CONCAT                                           ~4      ~3, !1
          5        CONCAT                                           ~5      ~4, '%0A'
          6        ECHO                                                     ~5
   25     7      > 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/OjiOn
function name:  destroy
number of ops:  5
compiled vars:  !0 = $id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   RECV                                             !0      
   29     1        CONCAT                                           ~1      'destroy+', !0
          2        CONCAT                                           ~2      ~1, '%0A'
          3        ECHO                                                     ~2
   30     4      > 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/OjiOn
function name:  gc
number of ops:  5
compiled vars:  !0 = $maxlifetime
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   32     0  E >   RECV                                             !0      
   34     1        CONCAT                                           ~1      'gc+', !0
          2        CONCAT                                           ~2      ~1, '%0A'
          3        ECHO                                                     ~2
   35     4      > RETURN                                                   null

End of function gc

End of class MySessionHandler.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.6 ms | 1400 KiB | 25 Q