3v4l.org

run code in 300+ PHP versions simultaneously
<?php function genRandomString() { $length = 10; $characters = "0123456789abcdefghijklmnopqrstuvwxyz"; $string = ""; for ($p = 0; $p < $length; $p++) { $string .= $characters[mt_rand(0, strlen($characters)-1)]; } return $string; } function makeRandomPath($dir, $ext) { do { $path = $dir."/".genRandomString().".".$ext; } while(file_exists($path)); return $path; } function makeRandomPathFromFilename($dir, $fn) { $ext = pathinfo($fn, PATHINFO_EXTENSION); echo $ext; return makeRandomPath($dir, $ext); } $target_path = makeRandomPathFromFilename("upload", "test.php./../../../../../../../etc/passwd.ff"); echo $target_path; ?>

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.00.0040.00915.13
7.3.120.0070.01314.76
7.3.110.0070.01015.02
7.3.100.0000.01314.69
7.3.90.0090.00314.73
7.3.80.0070.01114.57
7.3.70.0070.01115.04
7.3.60.0060.00915.04
7.3.50.0000.01014.99
7.3.40.0100.00314.93
7.3.30.0080.00614.72
7.3.20.0000.01616.71
7.3.10.0090.00516.71
7.3.00.0070.00716.77
7.2.250.0060.01314.68
7.2.240.0100.00714.73
7.2.230.0060.00915.09
7.2.220.0000.01415.25
7.2.210.0000.01515.15
7.2.200.0110.00415.11
7.2.190.0060.01214.79
7.2.180.0030.01014.91
7.2.170.0000.01314.94
7.2.130.0070.00417.09
7.2.120.0070.00816.86
7.2.110.0100.00917.08
7.2.100.0030.01217.03
7.2.90.0050.00916.90
7.2.80.0040.00916.95
7.2.70.0030.01216.96
7.2.60.0090.00516.96
7.2.50.0090.00617.06
7.2.40.0040.00816.96
7.2.30.0030.01017.02
7.2.20.0060.00817.13
7.2.10.0050.00816.99
7.2.00.0060.00517.65
7.1.330.0110.00416.06
7.1.320.0140.00015.72
7.1.310.0000.01315.83
7.1.300.0090.00615.88
7.1.290.0080.00615.83
7.1.280.0070.00715.64
7.1.270.0060.01015.83
7.1.260.0120.00615.95
7.1.250.0080.00615.63
7.1.70.0000.00917.09
7.1.60.0170.00719.17
7.1.50.0120.00916.99
7.1.00.0030.07322.54
7.0.200.0030.00316.92
7.0.140.0000.07722.18
7.0.100.0200.04319.86
7.0.90.0200.07319.92
7.0.80.0170.07019.89
7.0.70.0130.07319.86
7.0.60.0070.08319.88
7.0.50.0170.06320.30
7.0.40.0070.08320.06
7.0.30.0030.06720.02
7.0.20.0030.04020.05
7.0.10.0070.08020.02
7.0.00.0170.07320.07
5.6.280.0070.07020.82
5.6.250.0070.08020.68
5.6.240.0030.04720.47
5.6.230.0100.04720.52
5.6.220.0100.08020.63
5.6.210.0200.06720.59
5.6.200.0070.07720.92
5.6.190.0130.07020.98
5.6.180.0030.06021.03
5.6.170.0100.08320.99
5.6.160.0230.06720.96
5.6.150.0130.08320.98
5.6.140.0100.08021.04
5.6.130.0100.09020.91
5.6.120.0130.07720.89
5.6.110.0100.07720.90
5.6.100.0100.08020.96
5.6.90.0200.07321.04
5.6.80.0030.08320.34
5.6.70.0070.08020.36
5.6.60.0000.06320.37
5.6.50.0170.08720.28
5.6.40.0030.04720.37
5.6.30.0270.06020.43
5.6.20.0030.05020.27
5.6.10.0100.08320.42
5.6.00.0100.08020.38
5.5.380.0200.07020.36
5.5.370.0130.07720.30
5.5.360.0030.05320.44
5.5.350.0130.07020.37
5.5.340.0100.06320.73
5.5.330.0130.03720.79
5.5.320.0030.09020.79
5.5.310.0100.08320.75
5.5.300.0200.06720.82
5.5.290.0100.08320.68
5.5.280.0030.06320.88
5.5.270.0070.08020.88
5.5.260.0070.05020.84
5.5.250.0030.05020.57
5.5.240.0000.08720.17
5.5.230.0100.06720.20
5.5.220.0100.05020.16
5.5.210.0070.07320.07
5.5.200.0270.05020.14
5.5.190.0130.07719.95
5.5.180.0070.07320.19
5.5.160.0130.06720.22
5.5.150.0070.08020.21
5.5.140.0100.07720.22
5.5.130.0230.05020.06
5.5.120.0070.07020.20
5.5.110.0130.04720.18
5.5.100.0070.04319.94
5.5.90.0100.08020.08
5.5.80.0130.07720.13
5.5.70.0070.08720.01
5.5.60.0070.07320.07
5.5.50.0170.06720.02
5.5.40.0100.07020.10
5.5.30.0100.06320.04
5.5.20.0030.09020.04
5.5.10.0070.06320.05
5.5.00.0070.08020.03
5.4.450.0070.08319.38
5.4.440.0070.07719.51
5.4.430.0030.08319.44
5.4.420.0070.08019.16
5.4.410.0130.06319.38
5.4.400.0070.07719.06
5.4.390.0170.07319.13
5.4.380.0070.07718.95
5.4.370.0030.06018.84
5.4.360.0100.06019.20
5.4.350.0100.07319.03
5.4.340.0200.06319.12
5.4.320.0100.04718.85
5.4.310.0100.05319.03
5.4.300.0100.06019.12
5.4.290.0100.05019.14
5.4.280.0200.07719.17
5.4.270.0030.05318.89
5.4.260.0070.07319.03
5.4.250.0100.07319.13
5.4.240.0030.08018.95
5.4.230.0030.08019.11
5.4.220.0100.05719.13
5.4.210.0100.03719.12
5.4.200.0200.06018.84
5.4.190.0000.08019.22
5.4.180.0130.04318.89
5.4.170.0100.07319.04
5.4.160.0070.06718.88
5.4.150.0030.04719.16
5.4.140.0230.04016.41
5.4.130.0100.04316.39
5.4.120.0030.07716.17
5.4.110.0030.06316.54
5.4.100.0070.07316.58
5.4.90.0130.04316.44
5.4.80.0130.06716.43
5.4.70.0100.06716.46
5.4.60.0070.06716.31
5.4.50.0170.04316.39
5.4.40.0170.04316.39
5.4.30.0070.04716.36
5.4.20.0070.07016.41
5.4.10.0130.05316.24
5.4.00.0100.07315.73
5.3.290.0100.07314.79
5.3.280.0100.07314.52
5.3.270.0170.07314.68
5.3.260.0000.08014.70
5.3.250.0030.08014.57
5.3.240.0100.07014.57
5.3.230.0030.06014.66
5.3.220.0030.08014.64
5.3.210.0130.06714.56
5.3.200.0030.04714.49
5.3.190.0030.07314.65
5.3.180.0070.06014.63
5.3.170.0100.07314.50
5.3.160.0200.06014.68
5.3.150.0130.07314.66
5.3.140.0030.08014.70
5.3.130.0100.07714.50
5.3.120.0030.05314.56
5.3.110.0100.03314.48
5.3.100.0170.06714.11
5.3.90.0130.07014.09
5.3.80.0030.04013.98
5.3.70.0070.05013.95
5.3.60.0170.04013.96
5.3.50.0070.07313.86
5.3.40.0070.06714.01
5.3.30.0030.06313.92
5.3.20.0170.06313.80
5.3.10.0030.04013.56
5.3.00.0070.07013.66
5.2.170.0030.06311.17
5.2.160.0100.06011.18
5.2.150.0070.06311.14
5.2.140.0000.04011.09
5.2.130.0070.05311.25
5.2.120.0000.03711.21
5.2.110.0070.03311.06
5.2.100.0030.05011.21
5.2.90.0000.04011.17
5.2.80.0070.04011.16
5.2.70.0070.03311.16
5.2.60.0070.06311.05
5.2.50.0100.05711.12
5.2.40.0030.06011.01
5.2.30.0070.06010.91
5.2.20.0070.05711.08
5.2.10.0070.06010.92
5.2.00.0070.05710.84
5.1.60.0030.0579.99
5.1.50.0000.04710.01
5.1.40.0100.0309.98
5.1.30.0100.05310.40
5.1.20.0070.05710.43
5.1.10.0070.05310.14
5.1.00.0070.0379.96
5.0.50.0070.0438.64
5.0.40.0030.0438.41
5.0.30.0100.0608.24
5.0.20.0000.0378.29
5.0.10.0100.0338.03
5.0.00.0000.0538.25
4.4.90.0000.0207.74
4.4.80.0030.0407.74
4.4.70.0000.0407.74
4.4.60.0070.0307.74
4.4.50.0000.0237.74
4.4.40.0000.0307.74
4.4.30.0100.0307.74
4.4.20.0000.0307.74
4.4.10.0000.0407.74
4.4.00.0030.0537.74
4.3.110.0000.0377.74
4.3.100.0000.0337.74
4.3.90.0070.0307.74
4.3.80.0000.0507.74
4.3.70.0070.0307.74
4.3.60.0100.0237.74
4.3.50.0000.0237.74
4.3.40.0070.0437.74
4.3.30.0030.0307.74
4.3.20.0000.0177.74
4.3.10.0030.0337.74
4.3.00.0000.0237.74

preferences:
36.09 ms | 401 KiB | 5 Q