3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Simple { private $complicated; public function setComplicated(Complicated $complicated) { $this->complicated = $complicated; } public function __construct() { echo 'test1 '; } public function __destruct() { echo 'exit1 '; } } //Допустим есть еще некий класс Complicated, который может в себе содержать ссылку на класс Simple. class Complicated { private $simple; public function setSimple(Simple $simple) { $this->simple = $simple; } public function __construct() { echo 'test2 '; } public function __destruct() { echo 'exit2 '; } } $simple = new Simple(); $complicated = new Complicated(); $simple->setComplicated($complicated); $complicated->setSimple($simple); unset($simple); unset($complicated); echo 'end';
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3Z5Jb
function name:  (null)
number of ops:  16
compiled vars:  !0 = $simple, !1 = $complicated
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   45     0  E >   NEW                                              $2      'Simple'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   46     3        NEW                                              $5      'Complicated'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $5
   48     6        INIT_METHOD_CALL                                         !0, 'setComplicated'
          7        SEND_VAR_EX                                              !1
          8        DO_FCALL                                      0          
   49     9        INIT_METHOD_CALL                                         !1, 'setSimple'
         10        SEND_VAR_EX                                              !0
         11        DO_FCALL                                      0          
   51    12        UNSET_CV                                                 !0
   52    13        UNSET_CV                                                 !1
   53    14        ECHO                                                     'end'
         15      > RETURN                                                   1

Class Simple:
Function setcomplicated:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3Z5Jb
function name:  setComplicated
number of ops:  4
compiled vars:  !0 = $complicated
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    9     1        ASSIGN_OBJ                                               'complicated'
          2        OP_DATA                                                  !0
   10     3      > RETURN                                                   null

End of function setcomplicated

Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3Z5Jb
function name:  __construct
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   ECHO                                                     'test1+'
   15     1      > 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/3Z5Jb
function name:  __destruct
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   ECHO                                                     'exit1+'
   20     1      > RETURN                                                   null

End of function __destruct

End of class Simple.

Class Complicated:
Function setsimple:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3Z5Jb
function name:  setSimple
number of ops:  4
compiled vars:  !0 = $simple
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   RECV                                             !0      
   31     1        ASSIGN_OBJ                                               'simple'
          2        OP_DATA                                                  !0
   32     3      > RETURN                                                   null

End of function setsimple

Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3Z5Jb
function name:  __construct
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   36     0  E >   ECHO                                                     'test2+'
   37     1      > 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/3Z5Jb
function name:  __destruct
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   41     0  E >   ECHO                                                     'exit2+'
   42     1      > RETURN                                                   null

End of function __destruct

End of class Complicated.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.72 ms | 1399 KiB | 13 Q