3v4l.org

run code in 300+ PHP versions simultaneously
<?php $_POST = ['VAL0' => 'TESTING', 'UNIT0' => '99', 'VAL1' => 'TESTING1', 'UNITS1' => '88']; $bulkProducts = array(); foreach ($_POST as $key => $value) { if (strpos($key, "VAL")===0) { $val= $value; } if (strpos($key, "UNIT")===0) { $newunits= $value; } if (isset($val,$newunits)) { $products = array(); $products = array( 'VAL' => $val, 'UNITS' =>$newunits ); array_push($bulkProducts,$products); } } print_r($bulkProducts);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => Array ( [VAL] => TESTING [UNITS] => 99 ) [1] => Array ( [VAL] => TESTING1 [UNITS] => 99 ) [2] => Array ( [VAL] => TESTING1 [UNITS] => 88 ) )

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:
45.82 ms | 402 KiB | 8 Q