3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public $object; } class B { public $text = "some text"; } $var = new Test(); $var->object = new B; $cloned = clone $var; $cloned->object->text = "something naother"; var_dump($var == $cloned); var_dump($var); var_dump($cloned);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/c3692
function name:  (null)
number of ops:  23
compiled vars:  !0 = $var, !1 = $cloned
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   NEW                                              $2      'Test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   12     3        NEW                                              $6      'B'
          4        DO_FCALL                                      0          
          5        ASSIGN_OBJ                                               !0, 'object'
          6        OP_DATA                                                  $6
   14     7        CLONE                                            ~8      !0
          8        ASSIGN                                                   !1, ~8
   16     9        FETCH_OBJ_W                                      $10     !1, 'object'
         10        ASSIGN_OBJ                                               $10, 'text'
         11        OP_DATA                                                  'something+naother'
   18    12        INIT_FCALL                                               'var_dump'
         13        IS_EQUAL                                         ~12     !0, !1
         14        SEND_VAL                                                 ~12
         15        DO_ICALL                                                 
   20    16        INIT_FCALL                                               'var_dump'
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                                 
   21    19        INIT_FCALL                                               'var_dump'
         20        SEND_VAR                                                 !1
         21        DO_ICALL                                                 
         22      > RETURN                                                   1

Class Test: [no user functions]
Class B: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.64 ms | 1395 KiB | 15 Q