3v4l.org

run code in 300+ PHP versions simultaneously
<?php // First array, wont use unset $arr = array( 'a' => array('value' => 2), 'b' => array('value' => 4), 'c' => array('value' => 6) ); // Second copy, for unset $arr2 = $arr; // Loop and display without unset foreach ($arr as &$a) { $a['value'] /= 2; } echo "Without Unset:"; foreach ($arr as $a) { print_r($a); } // Loop and display with unset foreach ($arr2 as &$b) { $b['value'] /= 2; } unset($b); echo "With Unset:"; foreach ($arr2 as $b) { print_r($b); }
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 = 77) Position 1 = 10, Position 2 = 15
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 15
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 15
2 jumps found. (Code = 125) Position 1 = 17, Position 2 = 21
Branch analysis from position: 17
2 jumps found. (Code = 126) Position 1 = 18, Position 2 = 21
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 21
2 jumps found. (Code = 77) Position 1 = 25, Position 2 = 30
Branch analysis from position: 25
2 jumps found. (Code = 78) Position 1 = 26, Position 2 = 30
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 30
Branch analysis from position: 21
Branch analysis from position: 15
Branch analysis from position: 7
filename:       /in/69vW4
function name:  (null)
number of ops:  32
compiled vars:  !0 = $arr, !1 = $arr2, !2 = $a, !3 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, <array>
   10     1        ASSIGN                                                   !1, !0
   13     2      > FE_RESET_RW                                      $6      !0, ->7
          3    > > FE_FETCH_RW                                              $6, !2, ->7
   15     4    >   ASSIGN_DIM_OP                /=               4          !2, 'value'
          5        OP_DATA                                                  2
   13     6      > JMP                                                      ->3
          7    >   FE_FREE                                                  $6
   18     8        ECHO                                                     'Without+Unset%3A'
   19     9      > FE_RESET_R                                       $8      !0, ->15
         10    > > FE_FETCH_R                                               $8, !2, ->15
   21    11    >   INIT_FCALL                                               'print_r'
         12        SEND_VAR                                                 !2
         13        DO_ICALL                                                 
   19    14      > JMP                                                      ->10
         15    >   FE_FREE                                                  $8
   25    16      > FE_RESET_RW                                      $10     !1, ->21
         17    > > FE_FETCH_RW                                              $10, !3, ->21
   27    18    >   ASSIGN_DIM_OP                /=               4          !3, 'value'
         19        OP_DATA                                                  2
   25    20      > JMP                                                      ->17
         21    >   FE_FREE                                                  $10
   29    22        UNSET_CV                                                 !3
   30    23        ECHO                                                     'With+Unset%3A'
   31    24      > FE_RESET_R                                       $12     !1, ->30
         25    > > FE_FETCH_R                                               $12, !3, ->30
   33    26    >   INIT_FCALL                                               'print_r'
         27        SEND_VAR                                                 !3
         28        DO_ICALL                                                 
   31    29      > JMP                                                      ->25
         30    >   FE_FREE                                                  $12
   34    31      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.39 ms | 1400 KiB | 15 Q