3v4l.org

run code in 300+ PHP versions simultaneously
<?php $target_dir = "uploads/"; $target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]); $uploadOk = 1; $imageFileType = pathinfo($target_file,PATHINFO_EXTENSION); // Check if image file is a actual image or fake image if(isset($_POST["submit"])) { $check = getimagesize($_FILES["fileToUpload"]["tmp_name"]); if($check !== false) { echo "File is an image - " . $check["mime"] . "."; $uploadOk = 1; } else { echo "File is not an image."; $uploadOk = 0; } } ?>
Output for git.master, git.master_jit
Warning: Undefined array key "fileToUpload" in /in/OLJb4 on line 3 Warning: Trying to access array offset on value of type null in /in/OLJb4 on line 3 Deprecated: basename(): Passing null to parameter #1 ($path) of type string is deprecated in /in/OLJb4 on line 3
Output for rfc.property-hooks
Warning: Undefined array key "fileToUpload" in /in/OLJb4 on line 3 Warning: Trying to access array offset on null in /in/OLJb4 on line 3 Deprecated: basename(): Passing null to parameter #1 ($path) of type string is deprecated in /in/OLJb4 on line 3

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
45.66 ms | 401 KiB | 8 Q