3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public $b = false; public $e = 12; function __construct($oB) { $this->b = $oB; } } class B { public $a = false; function __construct($oA) { $this->a = $oA; } } $aDepends = array(); $pLink = function() use (&$aDepends) { return $aDepends['A']; }; $oB = new B($pLink); $oA = new A($oB); $aDepends['A']=$oA; //$aDepends=$oA; //$oB->a = $oA; //var_dump($oA); //var_dump($oB); var_dump($oB->a->e);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nknUH
function name:  (null)
number of ops:  20
compiled vars:  !0 = $aDepends, !1 = $pLink, !2 = $oB, !3 = $oA
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   ASSIGN                                                   !0, <array>
   18     1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FnknUH%3A18%240'
          2        BIND_LEXICAL                                             ~5, !0
          3        ASSIGN                                                   !1, ~5
   22     4        NEW                                              $7      'B'
          5        SEND_VAR_EX                                              !1
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !2, $7
   24     8        NEW                                              $10     'A'
          9        SEND_VAR_EX                                              !2
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !3, $10
   25    12        ASSIGN_DIM                                               !0, 'A'
         13        OP_DATA                                                  !3
   33    14        INIT_FCALL                                               'var_dump'
         15        FETCH_OBJ_R                                      ~14     !2, 'a'
         16        FETCH_OBJ_R                                      ~15     ~14, 'e'
         17        SEND_VAL                                                 ~15
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FnknUH%3A18%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nknUH
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $aDepends
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   BIND_STATIC                                              !0
   19     1        FETCH_DIM_R                                      ~1      !0, 'A'
          2      > RETURN                                                   ~1
   20     3*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FnknUH%3A18%240

Class A:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nknUH
function name:  __construct
number of ops:  4
compiled vars:  !0 = $oB
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        ASSIGN_OBJ                                               'b'
          2        OP_DATA                                                  !0
    8     3      > 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/nknUH
function name:  __construct
number of ops:  4
compiled vars:  !0 = $oA
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   13     1        ASSIGN_OBJ                                               'a'
          2        OP_DATA                                                  !0
   14     3      > RETURN                                                   null

End of function __construct

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.59 ms | 1400 KiB | 15 Q