3v4l.org

run code in 300+ PHP versions simultaneously
<?php $ydd_api_prefix = '7-'; $items = ['123', '456', '7-123', '7-432']; $referenced_nids = array_reduce($items, function ($return, $yle_id) use ($ydd_api_prefix) { if (strpos($yle_id, $ydd_api_prefix) === 0) { $return[] = substr($yle_id, strlen($ydd_api_prefix)); } return $return; }, []); var_dump($referenced_nids);
Output for git.master, git.master_jit, rfc.property-hooks
array(2) { [0]=> string(3) "123" [1]=> string(3) "432" }

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:
33.13 ms | 401 KiB | 8 Q