3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $drinks = array("maza","coffe","coffe","coffe"); $foods = array("coffe","choco","choco","choco","appy","kurkure","maggi"); $temp=0; foreach($drinks as $drink){ //you could use foreach instead of for foreach($foods as $food){ if($drink==$food){ $temp++; } //always use brakets } echo "word count of".$drink.' is '.$temp; echo "<br/>"; //br looks like this
Output for 5.4.0 - 5.4.28
Parse error: syntax error, unexpected end of file in /in/NbaR2 on line 19
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected $end in /in/NbaR2 on line 19
Process exited with code 255.