3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class B { public $var; public function __construct($var) { $this->var = $var; } } class A { public $var; public function __construct(B $var) { $this->var = $var; } } $b = new B('test'); $a = new A($b); $b->var = 'test2'; echo $b; echo $a;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/06Ys2
function name:  (null)
number of ops:  15
compiled vars:  !0 = $b, !1 = $a
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   2     0  E >   NOP                                                      
   8     1        NOP                                                      
  15     2        NEW                                              $4      :-5
         3        SEND_VAL_EX                                              'test'
         4        DO_FCALL                                      0          
         5        ASSIGN                                                   !0, $4
  16     6        NEW                                              $7      :-2
         7        SEND_VAR_EX                                              !0
         8        DO_FCALL                                      0          
         9        ASSIGN                                                   !1, $7
  18    10        ASSIGN_OBJ                                               !0, 'var'
        11        OP_DATA                                                  'test2'
  20    12        ECHO                                                     !0
  21    13        ECHO                                                     !1
        14      > RETURN                                                   1

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

End of function __construct

End of class B.

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

End of function __construct

End of class A.

Generated using Vulcan Logic Dumper, using php 7.3.0