3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = array( array('Status' => 'OK', 'Productname' => 'test1'), array('Status' => 'OK', 'Productname' => 'test1'), array('Status' => 'OK', 'Productname' => 'test2'), array('Status' => 'OK', 'Productname' => 'test2') ); $uniq_name = 'test1'; $key = 'Productname'; $b = array(); $uniq = array(); array_walk($a, function($a) use (&$b,$key,$uniq_name,&$uniq) { $name = $a[$key]; if ($name !== $uniq_name || $b[$name]++ == 0) $uniq[] = $a; }); print_r($uniq);
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined array key "test1" in /in/RQ7eh on line 18 Array ( [0] => Array ( [Status] => OK [Productname] => test1 ) [1] => Array ( [Status] => OK [Productname] => test2 ) [2] => Array ( [Status] => OK [Productname] => test2 ) )

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