3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { public $bar = false; public function __clone() { $this->bar = true; } } $baz = new foo; var_dump($baz->bar); $qux = clone $baz; var_dump($baz->bar); var_dump($qux->bar);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qd40n
function name:  (null)
number of ops:  18
compiled vars:  !0 = $baz, !1 = $qux
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   NEW                                              $2      'foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   12     3        INIT_FCALL                                               'var_dump'
          4        FETCH_OBJ_R                                      ~5      !0, 'bar'
          5        SEND_VAL                                                 ~5
          6        DO_ICALL                                                 
   14     7        CLONE                                            ~7      !0
          8        ASSIGN                                                   !1, ~7
   15     9        INIT_FCALL                                               'var_dump'
         10        FETCH_OBJ_R                                      ~9      !0, 'bar'
         11        SEND_VAL                                                 ~9
         12        DO_ICALL                                                 
   16    13        INIT_FCALL                                               'var_dump'
         14        FETCH_OBJ_R                                      ~11     !1, 'bar'
         15        SEND_VAL                                                 ~11
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

Class foo:
Function __clone:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qd40n
function name:  __clone
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ASSIGN_OBJ                                               'bar'
          1        OP_DATA                                                  <true>
    8     2      > RETURN                                                   null

End of function __clone

End of class foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.52 ms | 1395 KiB | 15 Q