3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public $b; function __destruct() { echo "a dtor\n"; $this->b->doSomething(); } } class B { function __destruct() { echo "b dtor\n"; } function doSomething() { echo "b still alive\n"; } } $a = new A; $b =& $a->b; $b = new B;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/B8QEb
function name:  (null)
number of ops:  9
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   NEW                                              $2      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
          3        FETCH_OBJ_W                                      $5      !0, 'b'
          4        ASSIGN_REF                                               !1, $5
    6     5        NEW                                              $7      'B'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $7
          8      > RETURN                                                   1

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

End of function __destruct

End of class A.

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

End of function __destruct

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

End of function dosomething

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
132.12 ms | 1386 KiB | 13 Q