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"; } } $b = new B; $a = new A; $a->b = $b;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rIY5T
function name:  (null)
number of ops:  9
compiled vars:  !0 = $b, !1 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   NEW                                              $2      'B'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
    6     3        NEW                                              $5      'A'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $5
          6        ASSIGN_OBJ                                               !1, 'b'
          7        OP_DATA                                                  !0
          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/rIY5T
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/rIY5T
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/rIY5T
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:
148.73 ms | 1395 KiB | 13 Q