3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = ' Hello 20.04.2016 🚩 my incredibleness face😘face is XYZ '; $words = preg_split('/\s+/', $text, 0, PREG_SPLIT_NO_EMPTY); $wordsLength = array_map('mb_strlen', $words); $lengthCounts = array_count_values($wordsLength); $defaultCounts = array_fill_keys(range(1,10), 0); $filteredCounts = array_intersect_key($lengthCounts, $defaultCounts); $gaplessCounts = array_replace($defaultCounts, $filteredCounts); var_export($words); echo "\n"; var_export($wordsLength); echo "\n"; var_export($lengthCounts); echo "\n"; var_export($defaultCounts); echo "\n"; var_export($filteredCounts); echo "\n"; var_export($gaplessCounts);
Output for git.master, git.master_jit, rfc.property-hooks
array ( 0 => 'Hello', 1 => '20.04.2016', 2 => '🚩', 3 => 'my', 4 => 'incredibleness', 5 => 'face😘face', 6 => 'is', 7 => 'XYZ', ) array ( 0 => 5, 1 => 10, 2 => 1, 3 => 2, 4 => 14, 5 => 9, 6 => 2, 7 => 3, ) array ( 5 => 1, 10 => 1, 1 => 1, 2 => 2, 14 => 1, 9 => 1, 3 => 1, ) array ( 1 => 0, 2 => 0, 3 => 0, 4 => 0, 5 => 0, 6 => 0, 7 => 0, 8 => 0, 9 => 0, 10 => 0, ) array ( 5 => 1, 10 => 1, 1 => 1, 2 => 2, 9 => 1, 3 => 1, ) array ( 1 => 1, 2 => 2, 3 => 1, 4 => 0, 5 => 1, 6 => 0, 7 => 0, 8 => 0, 9 => 1, 10 => 1, )

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