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 ($array 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);
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined variable $array in /in/7WJXW on line 16 Warning: foreach() argument must be of type array|object, null given in /in/7WJXW on line 16 Array ( [0] => Array ( [user_id] => 21 [email] => momod@modara.com [brand] => Array ( [0] => GOFUEL_W [1] => GOFUEL_USD_W ) ) [1] => Array ( [user_id] => 22 [email] => hemisphere@modara.com [brand] => Array ( [0] => GOFUEL_W ) ) [2] => Array ( [user_id] => 23 [email] => madoka@modara.com [brand] => Array ( [0] => GOFUEL_W [1] => GOFUEL_USD_W [2] => GOFUEL_BGD_W ) ) )

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
40.11 ms | 403 KiB | 8 Q