3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ [1, 2014, 'context' => 'aaa'], [12, 2014, 'context' => 'aaa'], [5, 2014, 'context' => 'zzz'], ]; foreach ($array as $i => &$row) { if (!isset($ref[$row['context']])) { $ref[$row['context']] = &$row[0]; } else { $ref[$row['context']] += $row[0]; unset($array[$i]); } } var_export($array);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 2, Position 2 = 20
Branch analysis from position: 2
2 jumps found. (Code = 126) Position 1 = 3, Position 2 = 20
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 14
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/qXjCE
function name:  (null)
number of ops:  25
compiled vars:  !0 = $array, !1 = $row, !2 = $i, !3 = $ref
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    9     1      > FE_RESET_RW                                      $5      !0, ->20
          2    > > FE_FETCH_RW                                      ~6      $5, !1, ->20
          3    >   ASSIGN                                                   !2, ~6
   10     4        FETCH_DIM_R                                      ~8      !1, 'context'
          5        ISSET_ISEMPTY_DIM_OBJ                         0  ~9      !3, ~8
          6        BOOL_NOT                                         ~10     ~9
          7      > JMPZ                                                     ~10, ->14
   11     8    >   FETCH_DIM_R                                      ~11     !1, 'context'
          9        FETCH_DIM_W                                      $13     !1, 0
         10        MAKE_REF                                         $14     $13
         11        FETCH_DIM_W                                      $12     !3, ~11
         12        ASSIGN_REF                                               $12, $14
   10    13      > JMP                                                      ->19
   13    14    >   FETCH_DIM_R                                      ~16     !1, 'context'
         15        FETCH_DIM_R                                      ~18     !1, 0
         16        ASSIGN_DIM_OP                +=               1          !3, ~16
         17        OP_DATA                                                  ~18
   14    18        UNSET_DIM                                                !0, !2
    9    19    > > JMP                                                      ->2
         20    >   FE_FREE                                                  $5
   17    21        INIT_FCALL                                               'var_export'
         22        SEND_VAR                                                 !0
         23        DO_ICALL                                                 
         24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.54 ms | 1006 KiB | 14 Q