3v4l.org

run code in 500+ PHP versions simultaneously
<?php $arr = ["ia", "ai", "go", "og", "og", "cr", "og", "rc"]; $new = array_reduce($arr, function ($acc, $item) { if (!in_array($item, $acc) && !in_array(strrev($item), $acc)) { array_push($acc, $item); } return $acc; }, []); print_r($new); //Array ( [0] => ia [1] => go [2] => cr )
Output for rfc.property-hooks
Array ( [0] => ia [1] => go [2] => cr )

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:
47.41 ms | 1429 KiB | 4 Q