3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function GetTheAnswer() { return 1; } function GetOtherAnswer() { if(GetTheAnswer() = 2) { return 4; } else { return 5; } } global $theAnswer = GetTheAnswer(); $otherAnswer = GetOtherAnswer(); $averageAnswer = ($theAnswer + $otherAnswer) / 2; echo $averageAnswer;
Output for 7.0.0 - 7.0.2
Parse error: syntax error, unexpected '=', expecting ',' or ';' in /in/mT5TR on line 15
Process exited with code 255.
Output for 5.3.22 - 5.6.17
Fatal error: Can't use function return value in write context in /in/mT5TR on line 8
Process exited with code 255.