3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private $bObj; public function __construct() { $this->bObj = new B($this); } } class B { private $owner; public function __construct($owner) { $this->owner = $owner; } } var_dump(memory_get_usage()); $aObj = new A(); var_dump(memory_get_usage()); unset($aObj); var_dump(memory_get_usage()); // memory uncleared!!!
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IlGFo
function name:  (null)
number of ops:  20
compiled vars:  !0 = $aObj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'memory_get_usage'
          2        DO_ICALL                                         $1      
          3        SEND_VAR                                                 $1
          4        DO_ICALL                                                 
   23     5        NEW                                              $3      'A'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !0, $3
   24     8        INIT_FCALL                                               'var_dump'
          9        INIT_FCALL                                               'memory_get_usage'
         10        DO_ICALL                                         $6      
         11        SEND_VAR                                                 $6
         12        DO_ICALL                                                 
   25    13        UNSET_CV                                                 !0
   26    14        INIT_FCALL                                               'var_dump'
         15        INIT_FCALL                                               'memory_get_usage'
         16        DO_ICALL                                         $8      
         17        SEND_VAR                                                 $8
         18        DO_ICALL                                                 
   27    19      > RETURN                                                   1

Class A:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IlGFo
function name:  __construct
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   NEW                                              $1      'B'
          1        FETCH_THIS                                       $2      
          2        SEND_VAR_EX                                              $2
          3        DO_FCALL                                      0          
          4        ASSIGN_OBJ                                               'bObj'
          5        OP_DATA                                                  $1
   10     6      > RETURN                                                   null

End of function __construct

End of class A.

Class B:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IlGFo
function name:  __construct
number of ops:  4
compiled vars:  !0 = $owner
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   19     1        ASSIGN_OBJ                                               'owner'
          2        OP_DATA                                                  !0
   20     3      > RETURN                                                   null

End of function __construct

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.2 ms | 1396 KiB | 17 Q