3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = new StdClass(); function something($first) { $first->test = "hello"; $b = clone $first; $b->value = 4; var_dump($b); } something($a); var_dump($a);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GBm2b
function name:  (null)
number of ops:  10
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $1      'StdClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   10     3        INIT_FCALL                                               'something'
          4        SEND_VAR                                                 !0
          5        DO_FCALL                                      0          
   11     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Function something:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GBm2b
function name:  something
number of ops:  11
compiled vars:  !0 = $first, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        ASSIGN_OBJ                                               !0, 'test'
          2        OP_DATA                                                  'hello'
    6     3        CLONE                                            ~3      !0
          4        ASSIGN                                                   !1, ~3
    7     5        ASSIGN_OBJ                                               !1, 'value'
          6        OP_DATA                                                  4
    8     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                                 
    9    10      > RETURN                                                   null

End of function something

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.04 ms | 1397 KiB | 16 Q