3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<html> <head> <title> Average</title> </head> <body> <?php $fname=$_REQUEST["fname"]; $lname=$_REQUEST["lname"]; $test1=$_REQUEST["test1"]; $test2=$_REQUEST["test2"]; $test3=$_REQUEST["test3"]; //test information $avg = average($test1, $test2, $test3); $lg = lettergrade($avg); fname(); lname(); $test1 = test1($avg); $test2 = test2($avg); $test3 = test3($avg); avg(); function fname() {print "First Name:"; print $fname; print "<br>"; print "<br>"; } function lname() {print "Last Name:"; print "<br>"; print "<br>"; } function test1() {print "Test 1"; print "<br>"; print "<br>"; } function test2() {print "Test 2"; print "<br>"; print "<br>"; } function test3() {print "Test 3"; print "<br>"; print "<br>"; } function avg() {print "Average Grade"; print "<br>"; print "<br>"; } function average($test1,$test2,$test3) { $avg = ($test1 + $test2 + $test3) / 3; return $avg; } function lettergrade($avg) { if ($avg >= 90) $lettergrade = "A"; if ($avg >= 80 && $avg <= 89) $lettergrade = "B"; if ($avg >= 70 && $avg <= 79) $lettergrade = "C"; if ($avg >= 60 && $avg <= 69) $lettergrade = "D"; if ($avg >= 50 && $avg <= 59) $lettergrade = "F"; return $lettergrade; } </body> </html
based on 5JlYO
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.4.32
Parse error: syntax error, unexpected '<' in /in/c5pj3 on line 148
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 '<' in /in/c5pj3 on line 148
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/c5pj3 on line 148
Process exited with code 255.