3v4l.org

run code in 300+ PHP versions simultaneously
<?php class SessionHandlerTester implements \SessionHandlerInterface { public function close(): bool { return true; } public function destroy($id): bool { return true; } public function gc($max_lifetime): int { return 1; } public function open($path, $name): bool { return true; } public function read($id): string { return ''; } public function write($id, $data): bool { return true; } //public function create_sid() { return uniqid(); } //public function validateId($key) { return true; } } $obj = new SessionHandlerTester(); ini_set('session.use_strict_mode','1'); session_set_save_handler($obj); session_start(); echo "\nvalidateId() ".(method_exists($obj,'validateId')?('returns '.($obj->validateId(1)?'true':'false')):'is commented out'); echo "\n"; $sessionId = session_create_id(); echo "\nSession ID:".$sessionId; echo "\n";
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 28
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 24
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9HCPE
function name:  (null)
number of ops:  39
compiled vars:  !0 = $obj, !1 = $sessionId
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   DECLARE_CLASS                                            'sessionhandlertester'
   24     1        NEW                                              $2      'SessionHandlerTester'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   25     4        INIT_FCALL                                               'ini_set'
          5        SEND_VAL                                                 'session.use_strict_mode'
          6        SEND_VAL                                                 '1'
          7        DO_ICALL                                                 
   26     8        INIT_FCALL                                               'session_set_save_handler'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                                 
   27    11        INIT_FCALL                                               'session_start'
         12        DO_ICALL                                                 
   29    13        INIT_FCALL                                               'method_exists'
         14        SEND_VAR                                                 !0
         15        SEND_VAL                                                 'validateId'
         16        DO_ICALL                                         $8      
         17      > JMPZ                                                     $8, ->28
         18    >   INIT_METHOD_CALL                                         !0, 'validateId'
         19        SEND_VAL_EX                                              1
         20        DO_FCALL                                      0  $9      
         21      > JMPZ                                                     $9, ->24
         22    >   QM_ASSIGN                                        ~10     'true'
         23      > JMP                                                      ->25
         24    >   QM_ASSIGN                                        ~10     'false'
         25    >   CONCAT                                           ~11     'returns+', ~10
         26        QM_ASSIGN                                        ~12     ~11
         27      > JMP                                                      ->29
         28    >   QM_ASSIGN                                        ~12     'is+commented+out'
         29    >   CONCAT                                           ~13     '%0AvalidateId%28%29+', ~12
         30        ECHO                                                     ~13
   30    31        ECHO                                                     '%0A'
   31    32        INIT_FCALL                                               'session_create_id'
         33        DO_ICALL                                         $14     
         34        ASSIGN                                                   !1, $14
   32    35        CONCAT                                           ~16     '%0ASession+ID%3A', !1
         36        ECHO                                                     ~16
   33    37        ECHO                                                     '%0A'
         38      > RETURN                                                   1

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

End of function close

Function destroy:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9HCPE
function name:  destroy
number of ops:  4
compiled vars:  !0 = $id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1      > RETURN                                                   <true>
          2*       VERIFY_RETURN_TYPE                                       
          3*     > 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/9HCPE
function name:  gc
number of ops:  4
compiled vars:  !0 = $max_lifetime
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1      > RETURN                                                   1
          2*       VERIFY_RETURN_TYPE                                       
          3*     > RETURN                                                   null

End of function gc

Function open:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9HCPE
function name:  open
number of ops:  5
compiled vars:  !0 = $path, !1 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2      > RETURN                                                   <true>
          3*       VERIFY_RETURN_TYPE                                       
          4*     > 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/9HCPE
function name:  read
number of ops:  4
compiled vars:  !0 = $id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
          1      > RETURN                                                   ''
          2*       VERIFY_RETURN_TYPE                                       
          3*     > 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/9HCPE
function name:  write
number of ops:  5
compiled vars:  !0 = $id, !1 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2      > RETURN                                                   <true>
          3*       VERIFY_RETURN_TYPE                                       
          4*     > RETURN                                                   null

End of function write

End of class SessionHandlerTester.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.18 ms | 1024 KiB | 18 Q