3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $inStr = 'Hey you guys'; $tokens = array(); for(explode(' ',$inStr) 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++) : $tokens[] = pop(str_split($bigToken)); //only need the first element here. endfor; endfor; print_r($tokens);
Output for 5.4.0 - 5.4.12
Parse error: syntax error, unexpected 'as' (T_AS), expecting ';' in /in/StS6C on line 4
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.22
Parse error: syntax error, unexpected T_AS, expecting ';' in /in/StS6C on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_AS, expecting ';' in /in/StS6C on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `';'' in /in/StS6C on line 4
Process exited with code 255.