3v4l.org

run code in 300+ PHP versions simultaneously
<?php $just = 1; do { //it //imagen1 if (isset($_FILES["eximg".$just])) { $allowedExts = array("gif", "jpeg", "jpg", "png"); $tmp = explode(".", $_FILES["eximg".$just]["name"]); $extension = end($tmp); if ((($_FILES["eximg".$just]["type"] == "image/gif") || ($_FILES["eximg".$just]["type"] == "image/jpeg") || ($_FILES["eximg".$just]["type"] == "image/jpg") || ($_FILES["eximg".$just]["type"] == "image/png")) && ($_FILES["eximg".$just]["size"] < 10485760)&& in_array($extension, $allowedExts)) { //DO $file = $_FILES['eximg'.$just]; $name = $file['name']; $tname = uniqid().$name; $path = "../tiendas/imagenes/" . basename($tname); if (move_uploaded_file($file['tmp_name'], $path)) { // Move succeed. } else { // Move failed. Possible duplicate? } //$sql = mysql_query("INSERT INTO `imagenes` (`url`,`prod_id` ) VALUES ('".$path."','".$idtienda."')"); $querry = 'UPDATE imagenes SET url="'.$path.'" WHERE id='.$_POST['eximg'.$just.''].''; $sql = mysql_query($querry) or trigger_error('Query failed: ' . mysql_error(), E_USER_ERROR); ; //display the success message echo "<center>Cambiaste la imagen satisfactoriamente!</center>"; // ... } else { $path = "../tiendas/imagenes/default.png"; $sql = mysql_query("INSERT INTO `imagenes` (`url`) VALUES ('".$path.")"); } } //termina img 1 } while ($just++ < 9); } }

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.200.0070.03612.39
5.4.190.0180.04012.38
5.4.180.0160.04312.38
5.4.170.0170.04212.38
5.4.160.0160.04412.38
5.4.150.0140.04612.38
5.4.140.0120.04612.07
5.4.130.0190.04112.04
5.4.120.0150.04212.02
5.4.110.0150.04212.01
5.4.100.0130.04712.01
5.4.90.0130.04612.01
5.4.80.0140.04512.01
5.4.70.0140.04312.00
5.4.60.0110.04712.01
5.4.50.0160.04112.01
5.4.40.0140.04312.00
5.4.30.0150.04411.99
5.4.20.0140.04411.98
5.4.10.0140.04311.99
5.4.00.0130.04211.48
5.3.270.0160.04612.72
5.3.260.0180.04312.72
5.3.250.0150.04612.72
5.3.240.0180.04312.72
5.3.230.0140.04812.71
5.3.220.0230.03712.68
5.3.210.0170.04512.68
5.3.200.0120.05312.68
5.3.190.0170.04512.68
5.3.180.0180.04312.68
5.3.170.0200.04112.67
5.3.160.0160.04512.67
5.3.150.0140.04612.68
5.3.140.0210.03912.66
5.3.130.0160.04512.66
5.3.120.0140.04712.66
5.3.110.0150.04712.66
5.3.100.0170.04412.12
5.3.90.0150.04412.09
5.3.80.0150.04512.08
5.3.70.0160.04412.08
5.3.60.0200.04012.06
5.3.50.0130.04712.00
5.3.40.0090.05012.00
5.3.30.0160.04211.95
5.3.20.0190.04011.72
5.3.10.0170.04011.69
5.3.00.0160.04111.68

preferences:
138.81 ms | 1394 KiB | 7 Q