3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<html> <body> <form method="post" action="<?php echo $_SERVER['PHP_SELF'];?>"> Name: <input type="text" name="fname"> <input type="submit"> </form> <?php if ($_SERVER["REQUEST_METHOD"] == "POST") { // collect value of input field $name = $_REQUEST['fname']; if (empty($name)) { echo "Name is empty"; } else { echo $name; } } ?> </body> </html>
Output for 5.3.0 - 5.6.30, hhvm-3.10.1 - 3.17.3, 7.0.0 - 7.2.0
<html> <body> <form method="post" action="/in/oiFVo"> Name: <input type="text" name="fname"> <input type="submit"> </form> Notice: Undefined index: REQUEST_METHOD in /in/oiFVo on line 10 </body> </html>
Output for 5.2.3 - 5.2.17
<html> <body> <form method="post" action="/in/oiFVo"> Name: <input type="text" name="fname"> <input type="submit"> </form> Notice: Undefined index: REQUEST_METHOD in /in/oiFVo on line 10 </body> </html>
Output for 4.3.0 - 5.2.2
<html> <body> <form method="post" action=""> Name: <input type="text" name="fname"> <input type="submit"> </form> Notice: Undefined index: REQUEST_METHOD in /in/oiFVo on line 10 </body> </html>