3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Database { function __destruct() { echo "Destroyed Database\n"; }} class Session { private $db; function __construct() { $this->db = new Database(); } function __destruct() { echo "Destroyed Session\n"; check(); } } $sess = new Session(); check(); die(); function check(){ global $sess; if(isset($sess)) echo "yes\n"; else echo "no\n"; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 79) Position 1 = -2
filename:       /in/P1h9u
function name:  (null)
number of ops:  7
compiled vars:  !0 = $sess
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   NEW                                              $1      'Session'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   19     3        INIT_FCALL_BY_NAME                                       'check'
          4        DO_FCALL                                      0          
   21     5      > EXIT                                                     
   27     6*     > RETURN                                                   1

Function check:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/P1h9u
function name:  check
number of ops:  7
compiled vars:  !0 = $sess
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   BIND_GLOBAL                                              !0, 'sess'
   25     1        ISSET_ISEMPTY_CV                                         !0
          2      > JMPZ                                                     ~1, ->5
          3    >   ECHO                                                     'yes%0A'
          4      > JMP                                                      ->6
   26     5    >   ECHO                                                     'no%0A'
   27     6    > > RETURN                                                   null

End of function check

Class Database:
Function __destruct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/P1h9u
function name:  __destruct
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ECHO                                                     'Destroyed+Database%0A'
    5     1      > RETURN                                                   null

End of function __destruct

End of class Database.

Class Session:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/P1h9u
function name:  __construct
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   NEW                                              $1      'Database'
          1        DO_FCALL                                      0          
          2        ASSIGN_OBJ                                               'db'
          3        OP_DATA                                                  $1
   11     4      > 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/P1h9u
function name:  __destruct
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   ECHO                                                     'Destroyed+Session%0A'
   14     1        INIT_FCALL_BY_NAME                                       'check'
          2        DO_FCALL                                      0          
   15     3      > RETURN                                                   null

End of function __destruct

End of class Session.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.21 ms | 1399 KiB | 13 Q