3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $inStr = 'Hey you guys'; $tokens = array(); $tokenList = explode(' ',$inStr); for($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++) { $tokens[] = pop(str_split($bigToken)); //only need the first element here. } } print_r($tokens);
Output for 5.4.0 - 5.4.12
Parse error: syntax error, unexpected 'as' (T_AS), expecting ';' in /in/QMV45 on line 5
Process exited with code 255.
Output for 5.3.0 - 5.3.22
Parse error: syntax error, unexpected T_AS, expecting ';' in /in/QMV45 on line 5
Process exited with code 255.