3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** Store Sessions in DB **/ session_set_save_handler( //open function($savePath, $sessionName) { return true; }, //close function() { require_once 'api/CManager.php'; $Manager = new \teachme\CManager(); $Manager->DeleteSessions(time()); return true; }, //read function($sessionID) { require_once 'api/CManager.php'; $Manager = new \teachme\CManager(); $Session = $Manager->GetSession($sessionID); if($Session->getLifetime() < time()) { return ""; } return $Session->getData(); }, //write function($sessionID, $data) { require_once 'api/CManager.php'; $Session = new \teachme\CSession(); $Session->setSessionID($sessionID); $Session->setLifetime(time() + get_cfg_var("session.gc_maxlifetime")); $Session->setData($data); $Manager = new \teachme\CManager(); return $Manager->Save($Session); }, //destroy function($sessionID) { require_once 'api/CManager.php'; $Manager = new \teachme\CManager(); return $Manager->DeleteSession($sessionID); }, //gc function($lifetime) { require_once 'api/CManager.php'; $Manager = new \teachme\CManager(); return $Manager->DeleteSessions(time()); }); /** /Store Sessions in DB **/
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QHR23
function name:  (null)
number of ops:  15
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'session_set_save_handler'
    5     1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FQHR23%3A5%240'
    8     2        SEND_VAL                                                 ~0
   10     3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FQHR23%3A10%241'
   16     4        SEND_VAL                                                 ~1
   18     5        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FQHR23%3A18%242'
   28     6        SEND_VAL                                                 ~2
   30     7        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FQHR23%3A30%243'
   39     8        SEND_VAL                                                 ~3
   41     9        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FQHR23%3A41%244'
   46    10        SEND_VAL                                                 ~4
   48    11        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FQHR23%3A48%245'
   53    12        SEND_VAL                                                 ~5
         13        DO_ICALL                                                 
   54    14      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FQHR23%3A5%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QHR23
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $savePath, !1 = $sessionName
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 %00%7Bclosure%7D%2Fin%2FQHR23%3A5%240

Function %00%7Bclosure%7D%2Fin%2FQHR23%3A10%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QHR23
function name:  {closure}
number of ops:  11
compiled vars:  !0 = $Manager
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INCLUDE_OR_EVAL                                          'api%2FCManager.php', REQUIRE_ONCE
   13     1        NEW                                              $2      'teachme%5CCManager'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   14     4        INIT_METHOD_CALL                                         !0, 'DeleteSessions'
          5        INIT_FCALL                                               'time'
          6        DO_ICALL                                         $5      
          7        SEND_VAR_NO_REF_EX                                       $5
          8        DO_FCALL                                      0          
   15     9      > RETURN                                                   <true>
   16    10*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FQHR23%3A10%241

Function %00%7Bclosure%7D%2Fin%2FQHR23%3A18%242:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 16
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QHR23
function name:  {closure}
number of ops:  20
compiled vars:  !0 = $sessionID, !1 = $Manager, !2 = $Session
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
   20     1        INCLUDE_OR_EVAL                                          'api%2FCManager.php', REQUIRE_ONCE
   21     2        NEW                                              $4      'teachme%5CCManager'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $4
   22     5        INIT_METHOD_CALL                                         !1, 'GetSession'
          6        SEND_VAR_EX                                              !0
          7        DO_FCALL                                      0  $7      
          8        ASSIGN                                                   !2, $7
   23     9        INIT_METHOD_CALL                                         !2, 'getLifetime'
         10        DO_FCALL                                      0  $9      
         11        INIT_FCALL                                               'time'
         12        DO_ICALL                                         $10     
         13        IS_SMALLER                                               $9, $10
         14      > JMPZ                                                     ~11, ->16
   25    15    > > RETURN                                                   ''
   27    16    >   INIT_METHOD_CALL                                         !2, 'getData'
         17        DO_FCALL                                      0  $12     
         18      > RETURN                                                   $12
   28    19*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FQHR23%3A18%242

Function %00%7Bclosure%7D%2Fin%2FQHR23%3A30%243:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QHR23
function name:  {closure}
number of ops:  29
compiled vars:  !0 = $sessionID, !1 = $data, !2 = $Session, !3 = $Manager
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   32     2        INCLUDE_OR_EVAL                                          'api%2FCManager.php', REQUIRE_ONCE
   33     3        NEW                                              $5      'teachme%5CCSession'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !2, $5
   34     6        INIT_METHOD_CALL                                         !2, 'setSessionID'
          7        SEND_VAR_EX                                              !0
          8        DO_FCALL                                      0          
   35     9        INIT_METHOD_CALL                                         !2, 'setLifetime'
         10        INIT_FCALL                                               'time'
         11        DO_ICALL                                         $9      
         12        INIT_FCALL                                               'get_cfg_var'
         13        SEND_VAL                                                 'session.gc_maxlifetime'
         14        DO_ICALL                                         $10     
         15        ADD                                              ~11     $9, $10
         16        SEND_VAL_EX                                              ~11
         17        DO_FCALL                                      0          
   36    18        INIT_METHOD_CALL                                         !2, 'setData'
         19        SEND_VAR_EX                                              !1
         20        DO_FCALL                                      0          
   37    21        NEW                                              $14     'teachme%5CCManager'
         22        DO_FCALL                                      0          
         23        ASSIGN                                                   !3, $14
   38    24        INIT_METHOD_CALL                                         !3, 'Save'
         25        SEND_VAR_EX                                              !2
         26        DO_FCALL                                      0  $17     
         27      > RETURN                                                   $17
   39    28*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FQHR23%3A30%243

Function %00%7Bclosure%7D%2Fin%2FQHR23%3A41%244:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QHR23
function name:  {closure}
number of ops:  10
compiled vars:  !0 = $sessionID, !1 = $Manager
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   41     0  E >   RECV                                             !0      
   43     1        INCLUDE_OR_EVAL                                          'api%2FCManager.php', REQUIRE_ONCE
   44     2        NEW                                              $3      'teachme%5CCManager'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $3
   45     5        INIT_METHOD_CALL                                         !1, 'DeleteSession'
          6        SEND_VAR_EX                                              !0
          7        DO_FCALL                                      0  $6      
          8      > RETURN                                                   $6
   46     9*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FQHR23%3A41%244

Function %00%7Bclosure%7D%2Fin%2FQHR23%3A48%245:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QHR23
function name:  {closure}
number of ops:  12
compiled vars:  !0 = $lifetime, !1 = $Manager
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   48     0  E >   RECV                                             !0      
   50     1        INCLUDE_OR_EVAL                                          'api%2FCManager.php', REQUIRE_ONCE
   51     2        NEW                                              $3      'teachme%5CCManager'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $3
   52     5        INIT_METHOD_CALL                                         !1, 'DeleteSessions'
          6        INIT_FCALL                                               'time'
          7        DO_ICALL                                         $6      
          8        SEND_VAR_NO_REF_EX                                       $6
          9        DO_FCALL                                      0  $7      
         10      > RETURN                                                   $7
   53    11*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FQHR23%3A48%245

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.88 ms | 1408 KiB | 19 Q