3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Verifico se si vuole fare ulpoad di un file if ( isset($_POST['uploaded-file']) ) { echo "Entrato"; $file_name = $_FILES["uploaded-file"]["name"]; if ( $file_name == "" ) { header('Location: ../home/index.php?error=1'); //echo "Non hai indicato alcun file per l'upload!"; return; } if ( is_uploaded_file($_FILES["uploaded-file"]["tmp_name"]) && $_FILES["uploaded-file"]['error'] == UPLOAD_ERR_OK ) { // Creo il percorso in cui verrà salvato il file $path = $_SESSION['path'].$file_name; if ( !file_exists( $path ) ) { if ( move_uploaded_file($_FILES["uploaded-file"]["tmp_name"], $path) ) { $file_type = 2; $exploded = explode('.', $file_name); $format = $exploded[count($exploded)-1]; $query = "select name from file_type where format = '".$format."' limit 1;"; $result = $conn->query( $query ); if ( $result->num_rows == 1 ) { $row = $result->fetch_array( MYSQLI_ASSOC ); $file_type = $row['format']; } $password = null; if ( isset($_POST['file-password']) ) { $password = $_POST['file-password']; } $file = sha1_file( $path ); // Aggiorno la tabella che tiene traccia dei file dell'utente $query = "insert into ".$_SESSION['user_id']."_files (file_name, file_path, file_type, owner, password, file) values ('".$file_name."', '".$_SESSION['path']."', '".$file_type."', '".$_SESSION['user_id']."', '".$password."', '".$file."');"; if ( !$conn->query( $query ) ) { header('Location: ../home/index.php?error=5'); //echo 'Errore inserimento nel database.'; } else { echo 'success'; header('Location: ../home/'); } } echo { header('Location: ../home/index.php?error=6'); //echo "Impossibile fare l'upload del file."; } } else { header('Location: ../home/index.php?error=7'); //echo "Esiste già un file con lo stesso nome!"; } } else { header('Location: ../home/index.php?error=8'); //echo "Problemi nell'upload del file."; } } ?>

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.290.0030.04312.50
5.4.280.0060.03712.39
5.4.270.0050.04212.39
5.4.260.0090.05212.39
5.4.250.0040.05712.39
5.4.240.0090.03712.39
5.4.230.0090.04012.39
5.4.220.0080.03812.39
5.4.210.0040.05512.39
5.4.200.0040.04412.39
5.4.190.0080.03912.38
5.4.180.0040.04312.38
5.4.170.0090.04112.39
5.4.160.0090.03812.39
5.4.150.0050.04012.38
5.4.140.0050.04512.07
5.4.130.0080.03512.05
5.4.120.0070.03512.02
5.4.110.0050.03812.02
5.4.100.0060.04512.01
5.4.90.0060.03912.02
5.4.80.0130.04612.02
5.4.70.0120.04212.02
5.4.60.0060.05212.02
5.4.50.0090.05212.02
5.4.40.0150.04612.00
5.4.30.0080.04312.00
5.4.20.0080.04711.99
5.4.10.0090.05212.00
5.4.00.0080.04811.49
5.3.280.0070.04912.71
5.3.270.0080.05212.73
5.3.260.0090.04112.72
5.3.250.0110.03612.72
5.3.240.0100.04112.72
5.3.230.0100.05012.71
5.3.220.0080.05412.68
5.3.210.0090.05612.68
5.3.200.0080.05312.68
5.3.190.0100.04912.68
5.3.180.0050.04012.67
5.3.170.0050.03912.67
5.3.160.0080.03612.67
5.3.150.0070.05512.67
5.3.140.0090.05212.66
5.3.130.0040.04412.66
5.3.120.0090.04112.66
5.3.110.0100.05512.66
5.3.100.0090.03812.12
5.3.90.0080.04812.08
5.3.80.0090.04212.08
5.3.70.0080.05012.08
5.3.60.0090.04512.06
5.3.50.0100.03812.00
5.3.40.0060.03912.00
5.3.30.0060.03711.96
5.3.20.0080.03711.75
5.3.10.0060.03811.71
5.3.00.0060.03711.70
5.2.170.0040.0349.20
5.2.160.0060.0309.20
5.2.150.0070.0359.20
5.2.140.0070.0339.20
5.2.130.0090.0309.16
5.2.120.0130.0339.16
5.2.110.0070.0319.17
5.2.100.0060.0309.16
5.2.90.0050.0319.16
5.2.80.0070.0429.16
5.2.70.0030.0349.16
5.2.60.0040.0349.11
5.2.50.0090.0329.08
5.2.40.0050.0329.06
5.2.30.0080.0329.04
5.2.20.0050.0369.02
5.2.10.0080.0368.95
5.2.00.0100.0388.80
5.1.60.0070.0338.09
5.1.50.0060.0268.09
5.1.40.0050.0328.07
5.1.30.0040.0338.41
5.1.20.0070.0278.44
5.1.10.0050.0308.16
5.1.00.0070.0368.17
5.0.50.0010.0266.64
5.0.40.0060.0276.51
5.0.30.0030.0376.32
5.0.20.0030.0286.29
5.0.10.0050.0246.26
5.0.00.0020.0356.25
4.4.90.0030.0244.78
4.4.80.0050.0234.75
4.4.70.0050.0234.75
4.4.60.0050.0214.76
4.4.50.0040.0224.77
4.4.40.0040.0344.71
4.4.30.0030.0164.75
4.4.20.0020.0244.84
4.4.10.0030.0184.85
4.4.00.0030.0324.76
4.3.110.0050.0134.67
4.3.100.0020.0154.67
4.3.90.0030.0174.64
4.3.80.0040.0254.59
4.3.70.0020.0154.63
4.3.60.0030.0154.63
4.3.50.0040.0154.63
4.3.40.0010.0264.54
4.3.30.0030.0183.31
4.3.20.0060.0143.29
4.3.10.0040.0143.25
4.3.00.0070.01710.55

preferences:
143.53 ms | 1394 KiB | 7 Q