3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<!DOCTYPE html> <html> <head> <title> Average</title> </head> <body> <?php $fname=$_GET["fname"]; $lname=$_GET["lname"]; $test1=$_GET["sub1"]; $test2=$_GET["sub2"]; $test3=$_GET["sub3"]; //subject information $avg = average($sub1, $sub2, $sub3); $lg = lettergrade($avg); fname(); lname(); $sub1 = sub1($avg); $sub2 = sub2($avg); $sub3 = sub3($avg); avg(); function fname() {print "First Name:"; print $fname; print "<br>"; print "<br>"; } function lname() {print "Last Name:"; print "<br>"; print "<br>"; } function sub1() {print "sub 1"; print "<br>"; print "<br>"; } function sub2() {print "sub 2"; print "<br>"; print "<br>"; } function sub3() {print "sub 3"; print "<br>"; print "<br>"; } function avg() {print "Average Grade"; print "<br>"; print "<br>"; } function average($sub1,$sub2,$sub3) { $avg = ($sub1 + $sub2 + $sub3)/3; return $avg; } function lettergrade($avg) { if ($avg >= 80 && $avg<=100) $lettergrade = "A"; if ($avg >=65 && $avg <= 79) $lettergrade = "B"; if ($avg >= 50 && $avg <= 64) $lettergrade = "C"; if ($avg >= 40 && $avg <= 49) $lettergrade = "D"; if ($avg >= 0 && $avg <= 39) $lettergrade = "E"; return $lettergrade; } </body> </html
based on VBTGa
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.4.32
Parse error: syntax error, unexpected '<' in /in/vFj3A on line 147
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/vFj3A on line 147
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/vFj3A on line 147
Process exited with code 255.