3v4l.org

run code in 300+ PHP versions simultaneously
<?php $inStr = 'Hey you. guys'; $tokens = array(); $tokenList = explode(' ',$inStr); foreach($tokenList as $bigToken) { $tokens[] = $bigToken; //take care of individual words $tokens = array_merge($tokens, str_split($bigToken)); //take care of single letters for($i = 2; $i < strlen($bigToken); $i++) { $tempArr = str_split($bigToken, $i); $tokens[] = array_shift($tempArr); //only need the first element here. } } print_r($tokens);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => Hey [1] => H [2] => e [3] => y [4] => He [5] => you. [6] => y [7] => o [8] => u [9] => . [10] => yo [11] => you [12] => guys [13] => g [14] => u [15] => y [16] => s [17] => gu [18] => guy )

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