3v4l.org

run code in 300+ PHP versions simultaneously
<?php $myarray = Array ( Array ( 'user_id' => 21, 'email' => 'momod@modara.com', 'brand' => Array ('GOFUEL_W','GOFUEL_USD_W')), Array ( 'user_id' => 22, 'email' => 'hemisphere@modara.com', 'brand' => Array ('GOFUEL_W')), Array ( 'user_id' => 23, 'email' => 'madoka@modara.com', 'brand' => Array ('GOFUEL_W','GOFUEL_USD_W','GOFUEL_BGD_W') ) ); foreach ($myarray as &$element) { if ($element['user_id'] != 22) continue; // skip this $element['brand'][] = "GO_FUEL_SGD_W"; break; // we are finished, don't need the elements after this one } print_r($myarray);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 2, Position 2 = 12
Branch analysis from position: 2
2 jumps found. (Code = 126) Position 1 = 3, Position 2 = 12
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 7
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
Branch analysis from position: 12
filename:       /in/ie0Hn
function name:  (null)
number of ops:  17
compiled vars:  !0 = $myarray, !1 = $element
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   16     1      > FE_RESET_RW                                      $3      !0, ->12
          2    > > FE_FETCH_RW                                              $3, !1, ->12
   17     3    >   FETCH_DIM_R                                      ~4      !1, 'user_id'
          4        IS_NOT_EQUAL                                             ~4, 22
          5      > JMPZ                                                     ~5, ->7
   18     6    > > JMP                                                      ->2
   20     7    >   FETCH_DIM_W                                      $6      !1, 'brand'
          8        ASSIGN_DIM                                               $6
          9        OP_DATA                                                  'GO_FUEL_SGD_W'
   21    10      > JMP                                                      ->12
   16    11*       JMP                                                      ->2
         12    >   FE_FREE                                                  $3
   24    13        INIT_FCALL                                               'print_r'
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.13 ms | 1395 KiB | 15 Q