3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public function __construct() { session_start(); $_SESSION['construct'] = true; var_dump($_SESSION); echo "constructor<br/>"; register_shutdown_function(function() { $_SESSION['shutdown'] = true; unset($_SESSION['construct']); echo "shutdown<br/>"; }); } public function __destruct() { session_write_close(); echo "destructor<br/>"; } } $test = new Test;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8dXFp
function name:  (null)
number of ops:  4
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   NEW                                              $1      'Test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
          3      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F8dXFp%3A13%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8dXFp
function name:  {closure}
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   FETCH_W                      global              $0      '_SESSION'
          1        ASSIGN_DIM                                               $0, 'shutdown'
          2        OP_DATA                                                  <true>
   15     3        FETCH_UNSET                                      $2      '_SESSION'
          4        UNSET_DIM                                                $2, 'construct'
   16     5        ECHO                                                     'shutdown%3Cbr%2F%3E'
   17     6      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F8dXFp%3A13%240

Class Test:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8dXFp
function name:  __construct
number of ops:  15
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'session_start'
          1        DO_ICALL                                                 
    8     2        FETCH_W                      global              $1      '_SESSION'
          3        ASSIGN_DIM                                               $1, 'construct'
          4        OP_DATA                                                  <true>
    9     5        INIT_FCALL                                               'var_dump'
          6        FETCH_R                      global              ~3      '_SESSION'
          7        SEND_VAL                                                 ~3
          8        DO_ICALL                                                 
   11     9        ECHO                                                     'constructor%3Cbr%2F%3E'
   13    10        INIT_FCALL                                               'register_shutdown_function'
         11        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F8dXFp%3A13%240'
   17    12        SEND_VAL                                                 ~5
         13        DO_ICALL                                                 
   18    14      > RETURN                                                   null

End of function __construct

Function __destruct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8dXFp
function name:  __destruct
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   INIT_FCALL                                               'session_write_close'
          1        DO_ICALL                                                 
   23     2        ECHO                                                     'destructor%3Cbr%2F%3E'
   24     3      > RETURN                                                   null

End of function __destruct

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.11 ms | 1400 KiB | 21 Q