3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = Array ( '0' => Array ( 'product_id' => 6, 'brand_id' => 2 ) , '1' => Array ( 'product_id' => 1, 'brand_id' => 1 ) , '2' => Array ( 'product_id' => 5, 'brand_id' => 1 ) ); $key = 'brand_id'; $return = array(); foreach($array as $v) { $return[$v[$key]][] = $v; } print_r(array_values($return)); ?>
Output for git.master_jit, git.master
/bin/php-git-master: error while loading shared libraries: libonig.so.5: cannot open shared object file: No such file or directory
Process exited with code 127.
Output for rfc.property-hooks
Array ( [0] => Array ( [0] => Array ( [product_id] => 6 [brand_id] => 2 ) ) [1] => Array ( [0] => Array ( [product_id] => 1 [brand_id] => 1 ) [1] => Array ( [product_id] => 5 [brand_id] => 1 ) ) )

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:
26.01 ms | 407 KiB | 5 Q