3v4l.org

run code in 300+ PHP versions simultaneously
<?php function uniqueNoEmpty($array) { return array_unique(array_filter($array, 'strlen')); } $original_string = 'one two three 喞 喝 four 刷囿 two 跏正 吁'; if (!preg_match_all('~(\p{Han}+)|(\S+)~u', $original_string, $out)) { echo 'no qualifying strings'; } else { $singleBytes = uniqueNoEmpty($out[2]) ?? []; $multiBytes = array_reverse(uniqueNoEmpty($out[1])); echo implode(' ', array_merge($singleBytes,$multiBytes)); }
Output for git.master, git.master_jit, rfc.property-hooks
one two three four 吁 跏正 刷囿 喝 喞

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:
25.36 ms | 405 KiB | 5 Q