3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = new \stdClass(); $a->b = 1; $a->c = 2; $d = clone $a; foreach ($d as $key=>&$value) { $value += 10; } unset($value); var_dump($a); var_dump($d);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 10, Position 2 = 14
Branch analysis from position: 10
2 jumps found. (Code = 126) Position 1 = 11, Position 2 = 14
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/5BbnE
function name:  (null)
number of ops:  23
compiled vars:  !0 = $a, !1 = $d, !2 = $value, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $4      'stdClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $4
    4     3        ASSIGN_OBJ                                               !0, 'b'
          4        OP_DATA                                                  1
    5     5        ASSIGN_OBJ                                               !0, 'c'
          6        OP_DATA                                                  2
    6     7        CLONE                                            ~9      !0
          8        ASSIGN                                                   !1, ~9
    7     9      > FE_RESET_RW                                      $11     !1, ->14
         10    > > FE_FETCH_RW                                      ~12     $11, !2, ->14
         11    >   ASSIGN                                                   !3, ~12
    8    12        ASSIGN_OP                                     1          !2, 10
    7    13      > JMP                                                      ->10
         14    >   FE_FREE                                                  $11
   10    15        UNSET_CV                                                 !2
   11    16        INIT_FCALL                                               'var_dump'
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                                 
   12    19        INIT_FCALL                                               'var_dump'
         20        SEND_VAR                                                 !1
         21        DO_ICALL                                                 
         22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.51 ms | 1399 KiB | 16 Q