3v4l.org

run code in 300+ PHP versions simultaneously
<?php class x { function __set($k, $v) { $this->$k = new y($v); } } class y { protected $name; public function __construct($n) { $this->name = $n; } } $x = new x; $x->a = 'a'; var_dump($x); $x->a = 'b'; var_dump($x);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LQTt8
function name:  (null)
number of ops:  14
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   NEW                                              $1      'x'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   23     3        ASSIGN_OBJ                                               !0, 'a'
          4        OP_DATA                                                  'a'
   24     5        INIT_FCALL                                               'var_dump'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                                 
   26     8        ASSIGN_OBJ                                               !0, 'a'
          9        OP_DATA                                                  'b'
   27    10        INIT_FCALL                                               'var_dump'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                                 
         13      > RETURN                                                   1

Class x:
Function __set:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LQTt8
function name:  __set
number of ops:  8
compiled vars:  !0 = $k, !1 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    7     2        NEW                                              $3      'y'
          3        SEND_VAR_EX                                              !1
          4        DO_FCALL                                      0          
          5        ASSIGN_OBJ                                               !0
          6        OP_DATA                                                  $3
    8     7      > RETURN                                                   null

End of function __set

End of class x.

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

End of function __construct

End of class y.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.53 ms | 1396 KiB | 15 Q