3v4l.org

run code in 300+ PHP versions simultaneously
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Martin Su - Allio Parser (Upload)</title> <link href="css/bootstrap.min.css" rel="stylesheet"> <link href="css/font-awesome.min.css" rel="stylesheet"> <link href="css/styles.css" rel="stylesheet"> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <br> <h1>http://admin-test.pmm/saves/index</h1> <form method="post" enctype="multipart/form-data"> Select image to upload: <input type="file" name="fileToUpload" id="fileToUpload"> <input type="submit" value="Upload Image" name="submit"> </form> <?php $target_dir = "files/retailers/id/"; $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; } } // Check if file already exists if (file_exists($target_file)) { echo "Sorry, file already exists."; $uploadOk = 0; } // Check file size if ($_FILES["fileToUpload"]["size"] > 1000000) { echo "Sorry, your file is too large."; $uploadOk = 0; } // Allow certain file formats if($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg" && $imageFileType != "gif" ) { echo "Sorry, only JPG, JPEG, PNG & GIF files are allowed."; $uploadOk = 0; } // Check if $uploadOk is set to 0 by an error if ($uploadOk == 0) { echo "Sorry, your file was not uploaded."; // if everything is ok, try to upload file } else { if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file)) { echo "The file ". basename( $_FILES["fileToUpload"]["name"]). " has been uploaded."; } else { echo "Sorry, there was an error uploading your file."; } } ?> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script src="js/bootstrap.min.js"></script> </body> </html>

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.3.60.0120.00918.31
8.3.50.0140.00718.17
8.3.40.0090.00618.98
8.3.30.0150.00818.71
8.3.20.0080.00020.11
8.3.10.0080.00021.91
8.3.00.0000.00821.73
8.2.180.0150.00418.54
8.2.170.0100.01022.96
8.2.160.0070.00721.07
8.2.150.0160.00624.18
8.2.140.0110.00724.66
8.2.130.0080.00022.08
8.2.120.0030.00526.35
8.2.110.0040.00820.56
8.2.100.0070.00417.97
8.2.90.0080.00019.39
8.2.80.0040.00418.05
8.2.70.0040.00417.75
8.2.60.0000.00817.93
8.2.50.0080.00018.16
8.2.40.0080.00020.32
8.2.30.0050.00321.11
8.2.20.0040.00418.07
8.2.10.0040.00418.37
8.2.00.0040.00418.32
8.1.280.0130.00325.92
8.1.270.0090.00020.79
8.1.260.0000.00826.35
8.1.250.0080.00028.09
8.1.240.0040.00423.86
8.1.230.0040.00823.77
8.1.220.0080.00017.77
8.1.210.0040.00418.77
8.1.200.0030.00617.35
8.1.190.0000.00817.53
8.1.180.0000.00818.10
8.1.170.0080.00318.92
8.1.160.0040.00418.93
8.1.150.0000.00721.94
8.1.140.0000.00719.69
8.1.130.0040.00419.04
8.1.120.0040.00417.55
8.1.110.0000.00717.55
8.1.100.0040.00417.54
8.1.90.0080.00017.40
8.1.80.0040.00417.39
8.1.70.0050.00217.49
8.1.60.0040.00417.68
8.1.50.0080.00017.58
8.1.40.0000.00817.45
8.1.30.0000.00817.65
8.1.20.0000.00817.64
8.1.10.0030.00617.55
8.1.00.0000.00817.53
8.0.300.0100.00018.77
8.0.290.0050.00316.88
8.0.280.0040.00418.41
8.0.270.0060.00217.31
8.0.260.0030.00317.16
8.0.250.0000.00717.09
8.0.240.0000.01016.97
8.0.230.0040.00417.09
8.0.220.0050.00317.04
8.0.210.0040.00317.04
8.0.200.0050.00317.07
8.0.190.0080.00016.93
8.0.180.0040.00417.06
8.0.170.0030.00616.92
8.0.160.0060.00317.01
8.0.150.0000.00716.89
8.0.140.0000.00716.95
8.0.130.0040.00413.39
8.0.120.0030.00516.91
8.0.110.0000.00816.78
8.0.100.0030.00517.06
8.0.90.0040.00416.95
8.0.80.0090.00617.02
8.0.70.0070.00017.17
8.0.60.0050.00317.02
8.0.50.0080.00016.94
8.0.30.0110.00917.22
8.0.20.0150.00517.40
8.0.10.0090.00017.14
8.0.00.0060.01316.97
7.4.330.0050.00015.55
7.4.320.0040.00416.65
7.4.300.0000.00716.56
7.4.290.0000.00816.45
7.4.280.0040.00416.55
7.4.270.0070.00016.68
7.4.260.0000.00716.64
7.4.250.0040.00416.62
7.4.240.0000.00716.62
7.4.230.0030.00316.66
7.4.220.0080.00816.75
7.4.210.0030.01116.68
7.4.200.0000.00716.62
7.4.160.0060.01116.47
7.4.150.0100.01017.40
7.4.140.0140.01217.86
7.4.130.0090.00816.45
7.4.120.0110.00816.61
7.4.110.0120.00616.61
7.4.100.0160.00616.65
7.4.90.0110.00716.61
7.4.80.0100.01319.39
7.4.70.0130.00316.60
7.4.60.0050.01416.61
7.4.50.0140.00316.52
7.4.40.0100.00616.60
7.4.30.0120.00616.52
7.4.00.0040.01415.09
7.3.330.0070.00013.21
7.3.320.0000.00613.36
7.3.310.0000.00716.53
7.3.300.0000.00716.35
7.3.290.0040.01216.46
7.3.280.0090.01016.43
7.3.270.0070.01017.40
7.3.260.0110.00816.49
7.3.250.0120.00416.41
7.3.240.0060.01016.50
7.3.230.0060.01216.55
7.3.210.0090.00916.37
7.3.200.0060.01716.46
7.3.190.0190.00316.59
7.3.180.0120.00916.36
7.3.170.0140.00716.68
7.3.160.0080.00816.44
7.3.120.0100.00714.99
7.3.110.0030.01414.77
7.3.100.0090.00614.80
7.3.90.0080.00714.87
7.3.80.0060.00714.68
7.3.70.0030.01014.97
7.3.60.0050.01114.84
7.3.50.0030.01114.88
7.3.40.0050.00814.85
7.3.30.0060.00714.63
7.3.20.0060.00816.76
7.3.10.0070.00816.76
7.3.00.0050.00616.75
7.2.330.0090.01616.53
7.2.320.0130.00316.79
7.2.310.0070.01116.70
7.2.300.0110.01116.75
7.2.290.0170.00616.70
7.2.240.0160.00214.95
7.2.230.0090.00715.21
7.2.220.0110.00115.21
7.2.210.0070.00815.23
7.2.200.0050.01114.93
7.2.190.0060.00915.02
7.2.180.0040.00914.91
7.2.170.0060.00815.19
7.2.160.0080.00515.35
7.2.150.0090.00817.11
7.2.140.0030.01116.83
7.2.130.0060.00816.96
7.2.120.0030.01216.74
7.2.110.0080.00916.75
7.2.100.0040.00817.04
7.2.90.0090.00616.97
7.2.80.0070.00917.15
7.2.70.0070.00717.10
7.2.60.0040.01216.92
7.2.50.0090.00617.14
7.2.40.0050.01017.00
7.2.30.0050.01216.93
7.2.20.0090.00417.03
7.2.10.0070.00817.02
7.2.00.0060.00617.81
7.1.330.0060.01015.76
7.1.320.0070.00515.89
7.1.310.0020.01215.86
7.1.300.0050.01115.96
7.1.290.0100.00215.83
7.1.280.0050.00715.70
7.1.270.0060.00715.69
7.1.260.0050.00615.80
7.1.250.0050.00915.92
7.1.200.0030.00815.79
7.1.70.0000.00716.73
7.1.60.0000.01317.25
7.1.50.0140.01116.93
7.1.40.0270.01034.46
7.1.30.0130.01734.48
7.1.20.0200.01334.59
7.1.10.0030.01016.43
7.1.00.0030.01016.54
7.0.200.0090.00916.79
7.0.180.0000.01316.27
7.0.170.0070.00716.15
7.0.160.0070.00716.05
7.0.150.0030.01316.13
7.0.140.0000.01016.32
7.0.130.0170.00316.35
7.0.120.0200.01314.59
7.0.110.0230.01314.41
7.0.100.0200.01714.44
7.0.90.0170.01014.49
7.0.80.0030.01316.29
7.0.70.0070.01016.34
7.0.60.0030.01316.13
7.0.50.0070.00716.48
7.0.40.0130.01014.69
7.0.30.0070.00716.58
7.0.20.0030.01016.27
7.0.10.0030.01316.53
7.0.00.0070.01016.49

preferences:
43.1 ms | 401 KiB | 5 Q