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) { die("found it!!!"); $subarray['brand'][] = "GO_FUEL_SGD_W"; } } print_r($myarray);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 11
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 11
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 10
Branch analysis from position: 6
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/qvqN3
function name:  (null)
number of ops:  16
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_R                                       $3      !0, ->11
          2    > > FE_FETCH_R                                               $3, !1, ->11
   17     3    >   FETCH_DIM_R                                      ~4      !1, 'user_id'
          4        IS_EQUAL                                                 ~4, 22
          5      > JMPZ                                                     ~5, ->10
   18     6    > > EXIT                                                     'found+it%21%21%21'
   19     7*       FETCH_DIM_W                                      $6      !1, 'brand'
          8*       ASSIGN_DIM                                               $6
          9*       OP_DATA                                                  'GO_FUEL_SGD_W'
   16    10    > > JMP                                                      ->2
         11    >   FE_FREE                                                  $3
   23    12        INIT_FCALL                                               'print_r'
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                                 
         15      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.11 ms | 1395 KiB | 15 Q