3v4l.org

run code in 500+ PHP versions simultaneously
<?php $test1 = $test2 = ['foo', 'bar']; foreach ($test1 as &$v) { $v = ['name' => $v]; } foreach ($test2 ?? [] as &$v) { $v = ['name' => $v]; } print_r($test1); print_r($test2);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
2 jumps found. (Code = 126) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 7
2 jumps found. (Code = 125) Position 1 = 11, Position 2 = 15
Branch analysis from position: 11
2 jumps found. (Code = 126) Position 1 = 12, Position 2 = 15
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
Branch analysis from position: 7
filename:       /in/RKcKn
function name:  (null)
number of ops:  23
compiled vars:  !0 = $test1, !1 = $test2, !2 = $v
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                               ~3      !1, <array>
          1        ASSIGN                                                       !0, ~3
    6     2      > FE_RESET_RW                                          $5      !0, ->7
          3    > > FE_FETCH_RW                                                  $5, !2, ->7
    7     4    >   INIT_ARRAY                                           ~6      !2, 'name'
          5        ASSIGN                                                       !2, ~6
    6     6      > JMP                                                          ->3
          7    >   FE_FREE                                                      $5
   10     8        COALESCE                                             ~8      !1
          9        QM_ASSIGN                                            ~8      <array>
         10      > FE_RESET_RW                                          $9      ~8, ->15
         11    > > FE_FETCH_RW                                                  $9, !2, ->15
   11    12    >   INIT_ARRAY                                           ~10     !2, 'name'
         13        ASSIGN                                                       !2, ~10
   10    14      > JMP                                                          ->11
         15    >   FE_FREE                                                      $9
   14    16        INIT_FCALL                                                   'print_r'
         17        SEND_VAR                                                     !0
         18        DO_ICALL                                                     
   16    19        INIT_FCALL                                                   'print_r'
         20        SEND_VAR                                                     !1
         21        DO_ICALL                                                     
         22      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
222.36 ms | 2036 KiB | 14 Q