3v4l.org

run code in 300+ PHP versions simultaneously
<?php public function upload_pass(Request $request) { foreach ($request->file() as $file) { $f = $file->move(storage_path('files'), time().'_'.$file->getClientOriginalName()); $img_format = pathinfo($f, PATHINFO_EXTENSION); if ($img_format == 'jpg') { $im = imagecreatefromjpeg($f); $contrast = -1500; imagefilter($im, IMG_FILTER_GRAYSCALE); imagefilter($im, IMG_FILTER_CONTRAST,$contrast); imagefilter($im, IMG_FILTER_NEGATE); imagejpeg($im, "new12.jpg"); } if ($img_format == 'png') { $im = imagecreatefrompng($f); $contrast = -1500; imagefilter($im, IMG_FILTER_GRAYSCALE); imagefilter($im, IMG_FILTER_CONTRAST,$contrast); imagefilter($im, IMG_FILTER_NEGATE); imagepng($im, "new12.png"); } } }

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)
7.4.120.0220.00816.31
7.4.110.0160.01416.18
7.4.100.0150.01616.37
7.4.90.0220.00716.29
7.4.80.0210.01016.45
7.4.70.0210.00716.39
7.4.60.0160.01116.38
7.4.50.0170.01216.37
7.4.40.0150.01516.38
7.4.30.0150.01416.35
7.4.20.0200.01116.42
7.4.10.0220.00516.42
7.4.00.0200.00616.42
7.3.240.0050.01116.26
7.3.230.0210.00816.18
7.3.220.0240.00816.27
7.3.210.0260.00916.28
7.3.200.0250.00816.29
7.3.190.0250.00516.20
7.3.180.0280.00116.20
7.3.170.0280.00316.18
7.3.160.0220.00916.19
7.3.150.0200.01116.22
7.3.140.0200.01316.36
7.3.130.0220.01216.28
7.3.120.0230.00516.17
7.3.110.0200.01216.28
7.3.100.0200.00916.11
7.3.90.0230.00716.20
7.3.80.0250.00416.18
7.3.70.0250.00316.20
7.3.60.0190.01116.21
7.3.50.0240.01016.19
7.3.40.0210.01016.18
7.3.30.0220.00816.20
7.3.20.0270.00616.25
7.3.10.0280.00616.37
7.3.00.0280.00716.27
7.2.340.0210.01016.19
7.2.330.0220.01216.40
7.2.320.0240.01016.36
7.2.310.0170.01116.22
7.2.300.0200.01016.27
7.2.290.0190.01016.32
7.2.280.0220.00816.49
7.2.270.0250.00616.32
7.2.260.0230.00716.31
7.2.250.0210.00716.25
7.2.240.0230.00716.46
7.2.230.0240.00816.31
7.2.220.0210.00916.27
7.2.210.0190.01216.40
7.2.200.0240.00816.33
7.2.190.0220.00916.37
7.2.180.0210.01116.44
7.2.170.0180.01316.29
7.2.160.0230.00716.22
7.2.150.0260.00716.33
7.2.140.0270.01016.39
7.2.130.0190.01316.29
7.2.120.0220.01116.46
7.2.110.0330.00316.33
7.2.100.0260.01316.29
7.2.90.0250.00916.29
7.2.80.0250.00616.36
7.2.70.0250.00716.32
7.2.60.0250.01016.40
7.2.50.0250.00916.39
7.2.40.0220.01016.36
7.2.30.0180.01216.32
7.2.20.0240.00816.23
7.2.10.0200.01216.41
7.2.00.0210.00916.37

preferences:
145.68 ms | 1000 KiB | 7 Q