3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public $ref; function __construct($ref = null) { $this->ref = $ref; } } $a = new Foo; $b = new Foo($a); $c = new Foo($b); $d = clone $c; $d->ref->ref->ref = 123; var_export([ $c, $d ]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PVpv2
function name:  (null)
number of ops:  23
compiled vars:  !0 = $a, !1 = $b, !2 = $c, !3 = $d
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   NEW                                              $4      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $4
   10     3        NEW                                              $7      'Foo'
          4        SEND_VAR_EX                                              !0
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $7
   11     7        NEW                                              $10     'Foo'
          8        SEND_VAR_EX                                              !1
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !2, $10
   12    11        CLONE                                            ~13     !2
         12        ASSIGN                                                   !3, ~13
   13    13        FETCH_OBJ_W                                      $15     !3, 'ref'
         14        FETCH_OBJ_W                                      $16     $15, 'ref'
         15        ASSIGN_OBJ                                               $16, 'ref'
         16        OP_DATA                                                  123
   14    17        INIT_FCALL                                               'var_export'
   15    18        INIT_ARRAY                                       ~18     !2
         19        ADD_ARRAY_ELEMENT                                ~18     !3
         20        SEND_VAL                                                 ~18
         21        DO_ICALL                                                 
   16    22      > RETURN                                                   1

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

End of function __construct

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.27 ms | 940 KiB | 16 Q