3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Testing shutdown sequence function checkSqlite() { if (!$GLOBALS['pdo']) echo "PDO connection\n"; } $pdo = new PDO('sqlite:memory'); function shutdown() { checkSqlite(); echo "register_shutdown_function\n"; } register_shutdown_function('shutdown'); class MyClass { function __destruct() { checkSqlite(); echo "Object destructor\n"; } } function obcallback($buffer) { checkSqlite(); $buffer .= "Output buffer callback\n"; return $buffer; } ob_start('obcallback'); $myObject = new MyClass; function dummy() { return true; } function sessionclose() { checkSqlite(); echo "Session close\n"; return true; } function sessionwrite() { checkSqlite(); echo "Session write\n"; return true; } session_set_save_handler('dummy','sessionclose','dummy','sessionwrite','dummy','dummy'); session_start(); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mcl9B
function name:  (null)
number of ops:  24
compiled vars:  !0 = $pdo, !1 = $myObject
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   NEW                                              $2      'PDO'
          1        SEND_VAL_EX                                              'sqlite%3Amemory'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   19     4        INIT_FCALL                                               'register_shutdown_function'
          5        SEND_VAL                                                 'shutdown'
          6        DO_ICALL                                                 
   42     7        INIT_FCALL                                               'ob_start'
          8        SEND_VAL                                                 'obcallback'
          9        DO_ICALL                                                 
   44    10        NEW                                              $7      'MyClass'
         11        DO_FCALL                                      0          
         12        ASSIGN                                                   !1, $7
   63    13        INIT_FCALL                                               'session_set_save_handler'
         14        SEND_VAL                                                 'dummy'
         15        SEND_VAL                                                 'sessionclose'
         16        SEND_VAL                                                 'dummy'
         17        SEND_VAL                                                 'sessionwrite'
         18        SEND_VAL                                                 'dummy'
         19        SEND_VAL                                                 'dummy'
         20        DO_ICALL                                                 
   65    21        INIT_FCALL                                               'session_start'
         22        DO_ICALL                                                 
   67    23      > RETURN                                                   1

Function checksqlite:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 5
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
filename:       /in/mcl9B
function name:  checkSqlite
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   FETCH_R                      global              ~0      'GLOBALS'
          1        FETCH_DIM_R                                      ~1      ~0, 'pdo'
          2        BOOL_NOT                                         ~2      ~1
          3      > JMPZ                                                     ~2, ->5
          4    >   ECHO                                                     'PDO+connection%0A'
    8     5    > > RETURN                                                   null

End of function checksqlite

Function shutdown:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mcl9B
function name:  shutdown
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'checksqlite'
          1        DO_FCALL                                      0          
   15     2        ECHO                                                     'register_shutdown_function%0A'
   17     3      > RETURN                                                   null

End of function shutdown

Function obcallback:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mcl9B
function name:  obcallback
number of ops:  6
compiled vars:  !0 = $buffer
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   34     0  E >   RECV                                             !0      
   36     1        INIT_FCALL                                               'checksqlite'
          2        DO_FCALL                                      0          
   37     3        ASSIGN_OP                                     8          !0, 'Output+buffer+callback%0A'
   38     4      > RETURN                                                   !0
   40     5*     > RETURN                                                   null

End of function obcallback

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

End of function dummy

Function sessionclose:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mcl9B
function name:  sessionclose
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   50     0  E >   INIT_FCALL                                               'checksqlite'
          1        DO_FCALL                                      0          
   51     2        ECHO                                                     'Session+close%0A'
   52     3      > RETURN                                                   <true>
   54     4*     > RETURN                                                   null

End of function sessionclose

Function sessionwrite:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mcl9B
function name:  sessionwrite
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   58     0  E >   INIT_FCALL                                               'checksqlite'
          1        DO_FCALL                                      0          
   59     2        ECHO                                                     'Session+write%0A'
   60     3      > RETURN                                                   <true>
   61     4*     > RETURN                                                   null

End of function sessionwrite

Class MyClass:
Function __destruct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mcl9B
function name:  __destruct
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   INIT_FCALL                                               'checksqlite'
          1        DO_FCALL                                      0          
   27     2        ECHO                                                     'Object+destructor%0A'
   29     3      > RETURN                                                   null

End of function __destruct

End of class MyClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.5 ms | 1398 KiB | 26 Q