3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { function __clone() { var_dump($this); } } $a = new A(); $a->x = new StdClass(); $b = clone $a;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BAkJ4
function name:  (null)
number of ops:  10
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   NEW                                              $2      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
    6     3        NEW                                              $6      'StdClass'
          4        DO_FCALL                                      0          
          5        ASSIGN_OBJ                                               !0, 'x'
          6        OP_DATA                                                  $6
    7     7        CLONE                                            ~8      !0
          8        ASSIGN                                                   !1, ~8
          9      > RETURN                                                   1

Class A:
Function __clone:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BAkJ4
function name:  __clone
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'var_dump'
          1        FETCH_THIS                                       ~0      
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
          4      > RETURN                                                   null

End of function __clone

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.73 ms | 1394 KiB | 15 Q