3v4l.org

run code in 300+ PHP versions simultaneously
<?php if($VAR['pic_upload']){ /* image upload */ $path = "upload/customers/"; $valid_formats = array("jpg", "png", "gif", "bmp", "jpeg"); if($_FILES['photoimg']['name']){ $name = $_FILES['photoimg']['name']; $size = $_FILES['photoimg']['size']; if(strlen($name)){ list($txt, $ext) = explode(".", $name); if(in_array($ext,$valid_formats) && $size<(1000*1024)){ $actual_image_name = $VAR["customer_id"].".".$ext; $tmp = $_FILES['photoimg']['tmp_name']; $new_path=$path.$actual_image_name; foreach(glob("upload/customers/$cid.*") as $file){ unlink($file); //delete old pics } if(move_uploaded_file($tmp, $new_path)){ force_page('customer,'customer_details&customer_id='.$cid.'&page_title=Image uploaded!'); die(); } else { force_page('core', 'error&error_msg=Error while saving the image'); die(); } } else { force_page('core', 'error&error_msg=Invalid Format or size'); die(); } } } }

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)
5.4.320.0050.03712.51
5.4.310.0070.03812.50
5.4.300.0050.03712.50
5.4.290.0050.03912.50
5.4.280.0050.03912.40
5.4.270.0050.03812.40
5.4.260.0080.03612.40
5.4.250.0060.04812.40
5.4.240.0060.03612.40
5.4.230.0090.03412.39
5.4.220.0110.03812.39
5.4.210.0060.03712.39
5.4.200.0070.03912.39
5.4.190.0040.03812.39
5.4.180.0050.04012.39
5.4.170.0100.03212.40
5.4.160.0050.03812.39
5.4.150.0080.03312.39
5.4.140.0050.03612.08
5.4.130.0050.03512.06
5.4.120.0050.03812.03
5.4.110.0090.03112.02
5.4.100.0040.03712.02
5.4.90.0100.03812.02
5.4.80.0050.04312.02
5.4.70.0140.03612.02
5.4.60.0040.03612.02
5.4.50.0060.03712.02
5.4.40.0080.03912.01
5.4.30.0060.04112.00
5.4.20.0090.04212.00
5.4.10.0070.03212.00
5.4.00.0040.03711.50
5.3.290.0090.03612.80
5.3.280.0100.03512.71
5.3.270.0030.04212.72
5.3.260.0080.03712.72
5.3.250.0070.04912.72
5.3.240.0080.03512.72
5.3.230.0030.04112.71
5.3.220.0050.03912.68
5.3.210.0030.04312.68
5.3.200.0040.04012.68
5.3.190.0070.03812.68
5.3.180.0090.03712.67
5.3.170.0040.03812.67
5.3.160.0070.03712.67
5.3.150.0060.03912.67
5.3.140.0050.03712.66
5.3.130.0060.03712.66
5.3.120.0040.03912.65
5.3.110.0070.04212.65
5.3.100.0080.03412.12
5.3.90.0110.03212.09
5.3.80.0060.03512.07
5.3.70.0100.04312.07
5.3.60.0050.03712.06
5.3.50.0070.03512.00
5.3.40.0030.03812.00
5.3.30.0050.03511.96
5.3.20.0060.03511.74
5.3.10.0050.03511.70
5.3.00.0070.03411.69
5.2.170.0080.0269.20
5.2.160.0040.0299.20
5.2.150.0050.0319.20
5.2.140.0040.0329.20
5.2.130.0030.0299.15
5.2.120.0100.0269.15
5.2.110.0040.0299.16
5.2.100.0040.0299.16
5.2.90.0040.0309.16
5.2.80.0070.0289.16
5.2.70.0040.0329.15
5.2.60.0070.0379.11
5.2.50.0060.0319.08
5.2.40.0030.0309.05
5.2.30.0030.0319.03
5.2.20.0050.0329.02
5.2.10.0080.0278.94
5.2.00.0060.0288.80
5.1.60.0020.0258.08
5.1.50.0030.0268.07
5.1.40.0030.0268.06
5.1.30.0050.0268.41
5.1.20.0040.0278.44
5.1.10.0020.0288.16
5.1.00.0040.0268.16
5.0.50.0000.0246.64
5.0.40.0040.0196.50
5.0.30.0040.0306.31
5.0.20.0040.0186.28
5.0.10.0040.0196.26
5.0.00.0060.0286.25
4.4.90.0010.0174.78
4.4.80.0020.0164.76
4.4.70.0020.0164.75
4.4.60.0020.0164.76
4.4.50.0010.0184.77
4.4.40.0030.0244.71
4.4.30.0030.0154.76
4.4.20.0020.0164.84
4.4.10.0020.0164.85
4.4.00.0020.0294.76
4.3.110.0030.0154.67
4.3.100.0050.0134.67
4.3.90.0020.0154.63
4.3.80.0030.0244.58
4.3.70.0010.0164.63
4.3.60.0030.0144.63
4.3.50.0030.0154.63
4.3.40.0040.0244.54
4.3.30.0010.0183.30
4.3.20.0010.0173.28
4.3.10.0010.0163.23
4.3.00.0070.01715.63

preferences:
138.8 ms | 1394 KiB | 7 Q