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 &$subarray) { if($subarray['user_id'] == 22) { $subarray['brand'][] = "GO_FUEL_SGD_W"; } } print_r($myarray);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 2, Position 2 = 10
Branch analysis from position: 2
2 jumps found. (Code = 126) Position 1 = 3, Position 2 = 10
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 9
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 9
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/ATkGD
function name:  (null)
number of ops:  15
compiled vars:  !0 = $myarray, !1 = $subarray
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   16     1      > FE_RESET_RW                                      $3      !0, ->10
          2    > > FE_FETCH_RW                                              $3, !1, ->10
   17     3    >   FETCH_DIM_R                                      ~4      !1, 'user_id'
          4        IS_EQUAL                                                 ~4, 22
          5      > JMPZ                                                     ~5, ->9
   18     6    >   FETCH_DIM_W                                      $6      !1, 'brand'
          7        ASSIGN_DIM                                               $6
          8        OP_DATA                                                  'GO_FUEL_SGD_W'
   16     9    > > JMP                                                      ->2
         10    >   FE_FREE                                                  $3
   22    11        INIT_FCALL                                               'print_r'
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.8 ms | 1395 KiB | 15 Q