3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $temp="test 1-123.456\ntest 2-789.0\n"; $tok=strtok($temp,"\n"); while ($tok !== false) { $pos=strpos($tok,'-'); $pos2=strpos($tok,'.',$pos); $temp2=substr($tok,0,$pos); $pos++; $wordlist[$temp2]=array((int)substr($tok,$pos,$pos2-$pos),(int)substr($tok,$pos2+1)); $tok=strtok("\n"); } } print_r($wordlist);
Output for 5.4.18
Parse error: syntax error, unexpected '}' in /in/cnnBS on line 14
Process exited with code 255.
Output for 5.3.0 - 5.4.17
Parse error: syntax error, unexpected '}' in /in/9e28Z on line 14
Process exited with code 255.