3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<html> <body> <form action="upload_file.php" method="post" enctype="multipart/form-data"> <label for="file">Filename:</label> <input type="file" name="file" id="file" size="20" /><br /> <input type="submit" name="submit" value="Submit" /> </form> </body> </html> <?php if (file_exists("upload/" . $_FILES["file"]["name"])) { echo $_FILES["file"]["name"] . " already exists. "; } else { move_uploaded_file($_FILES["file"]["tmp_name"],"upload/" . $_FILES["file"]["name"]); echo "Stored in: " . "upload/" . $_FILES["file"]["name"]; } ?>
Output for 5.3.0 - 7.1.0
<html> <body> <form action="upload_file.php" method="post" enctype="multipart/form-data"> <label for="file">Filename:</label> <input type="file" name="file" id="file" size="20" /><br /> <input type="submit" name="submit" value="Submit" /> </form> </body> </html> Notice: Undefined index: file in /in/eo8QM on line 11 Notice: Undefined index: file in /in/eo8QM on line 17 Notice: Undefined index: file in /in/eo8QM on line 17 Notice: Undefined index: file in /in/eo8QM on line 18 Stored in: upload/
Output for 4.3.0 - 5.2.17
<html> <body> <form action="upload_file.php" method="post" enctype="multipart/form-data"> <label for="file">Filename:</label> <input type="file" name="file" id="file" size="20" /><br /> <input type="submit" name="submit" value="Submit" /> </form> </body> </html> Notice: Undefined index: file in /in/eo8QM on line 11 Notice: Undefined index: file in /in/eo8QM on line 17 Notice: Undefined index: file in /in/eo8QM on line 17 Notice: Undefined index: file in /in/eo8QM on line 18 Stored in: upload/