3v4l.org

run code in 300+ PHP versions simultaneously
<?php $yourarray = [ 'ABC123-A', 'BG231-B', 'ABC123-A', 'BG231-E', 'BG231-F', 'BG231-G', 'BG231-H', 'ABC123-A', 'BG231-J', 'BG231-K', 'ABC123-A' ]; $duplicated=null; foreach($yourarray as $k => $v){ foreach($yourarray as $k2 => $v2){ if($v == $v2 && $k2 != $k){ $duplicated[$k]=$v; break; } } } var_export($duplicated);
Output for git.master, git.master_jit, rfc.property-hooks
array ( 0 => 'ABC123-A', 2 => 'ABC123-A', 7 => 'ABC123-A', 10 => 'ABC123-A', )

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:
44.29 ms | 1380 KiB | 4 Q