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); return makeRandomPath($dir, $ext); } $target_path = makeRandomPathFromFilename("upload", "test.php./../../../../../../../etc/passwd"); 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.0080.01015.01
7.3.120.0070.01014.95
7.3.110.0070.01014.97
7.3.100.0070.00914.98
7.3.90.0030.01214.94
7.3.80.0080.00414.96
7.3.70.0080.00815.02
7.3.60.0050.00714.66
7.3.50.0070.00714.98
7.3.40.0030.01114.82
7.3.30.0070.00714.76
7.3.20.0070.00816.86
7.3.10.0000.01516.76
7.3.00.0060.00916.70
7.2.250.0070.01015.14
7.2.240.0090.01015.16
7.2.230.0100.00615.00
7.2.220.0070.00915.21
7.2.210.0080.00615.18
7.2.200.0060.01015.23
7.2.190.0050.01014.92
7.2.180.0080.00815.17
7.2.170.0110.00315.21
7.1.330.0080.00615.91
7.1.320.0080.00515.80
7.1.310.0080.00315.87
7.1.300.0050.00915.99
7.1.290.0050.00615.78
7.1.280.0110.00615.79
7.1.270.0090.00515.77
7.1.260.0060.00815.96
7.1.70.0040.00417.33
7.1.60.0130.00019.21
7.1.50.0070.01417.02
7.1.00.0030.07722.32
7.0.200.0370.00914.73
7.0.140.0170.06322.00
7.0.110.0030.08319.82
7.0.100.0070.03720.01
7.0.90.0070.04019.96
7.0.80.0000.04320.03
7.0.70.0070.03720.06
7.0.60.0170.03719.95
7.0.50.0070.04319.95
7.0.40.0070.06719.79
7.0.30.0070.05319.67
7.0.20.0170.06719.86
7.0.10.0030.09019.86
7.0.00.0030.07719.68
5.6.280.0030.07321.10
5.6.260.0030.03720.66
5.6.250.0070.05320.70
5.6.240.0030.04320.67
5.6.230.0000.04720.67
5.6.220.0030.05720.68
5.6.210.0030.04020.74
5.6.200.0030.04020.67
5.6.190.0030.04720.60
5.6.180.0000.04320.55
5.6.170.0100.07720.66
5.6.160.0070.07720.56
5.6.150.0030.06020.62
5.6.140.0130.07320.57
5.6.130.0030.09020.65
5.6.120.0130.07720.54
5.6.110.0100.07720.58
5.6.100.0070.08320.64
5.6.90.0070.08020.64
5.6.80.0130.06719.98
5.6.70.0170.06719.93
5.6.60.0030.08319.94
5.6.50.0070.07720.21
5.6.40.0100.07319.93
5.6.30.0130.09020.07
5.6.20.0100.06719.88
5.6.10.0070.07019.93
5.6.00.0100.07719.93
5.5.380.0000.06020.55
5.5.370.0070.03720.55
5.5.360.0070.04020.36
5.5.350.0030.04020.47
5.5.340.0000.06320.76
5.5.330.0100.03320.91
5.5.320.0030.05320.89
5.5.310.0000.05720.71
5.5.300.0070.08021.00
5.5.290.0030.07720.91
5.5.280.0100.06321.03
5.5.270.0200.05020.74
5.5.260.0130.08020.90
5.5.250.0200.07020.77
5.5.240.0170.06720.09
5.5.230.0000.08320.13
5.5.220.0230.03720.29
5.5.210.0200.06720.23
5.5.200.0070.07720.35
5.5.190.0130.06720.30
5.5.180.0030.08020.23
5.5.160.0100.07720.17
5.5.150.0100.06720.05
5.5.140.0100.08020.17
5.5.130.0100.08020.31
5.5.120.0130.06720.22
5.5.110.0100.07720.29
5.5.100.0070.07320.24
5.5.90.0100.07720.13
5.5.80.0070.08720.26
5.5.70.0130.07020.24
5.5.60.0030.08020.08
5.5.50.0100.07320.23
5.5.40.0130.06320.22
5.5.30.0100.07320.24
5.5.20.0030.08020.13
5.5.10.0030.08320.23
5.5.00.0100.07320.17
5.4.450.0070.07019.42
5.4.440.0130.07019.36
5.4.430.0070.08019.31
5.4.420.0100.07319.32
5.4.410.0030.08019.18
5.4.400.0100.07719.34
5.4.390.0170.07719.00
5.4.380.0000.07719.16
5.4.370.0070.05719.32
5.4.360.0100.07319.31
5.4.350.0000.07319.18
5.4.340.0070.06319.09
5.4.320.0000.08319.09
5.4.310.0030.07019.19
5.4.300.0070.04318.99
5.4.290.0100.05019.09
5.4.280.0130.07719.22
5.4.270.0030.08318.98
5.4.260.0130.06719.00
5.4.250.0070.04719.24
5.4.240.0070.07718.94
5.4.230.0030.08018.99
5.4.220.0000.08319.05
5.4.210.0100.07318.97
5.4.200.0030.08319.18
5.4.190.0100.07018.99
5.4.180.0130.07019.33
5.4.170.0100.07318.98
5.4.160.0070.07018.96
5.4.150.0070.08319.00
5.4.140.0070.07016.36
5.4.130.0030.04716.29
5.4.120.0030.07716.56
5.4.110.0170.03016.62
5.4.100.0030.04316.46
5.4.90.0070.07016.33
5.4.80.0030.07716.30
5.4.70.0130.06016.29
5.4.60.0100.06316.46
5.4.50.0100.06716.24
5.4.40.0130.06016.61
5.4.30.0100.04316.54
5.4.20.0000.07016.28
5.4.10.0130.06016.39
5.4.00.0100.07315.93
5.3.290.0100.07014.69
5.3.280.0100.07014.68
5.3.270.0030.08014.57
5.3.260.0070.07314.74
5.3.250.0070.07314.74
5.3.240.0030.05714.57
5.3.230.0000.08014.73
5.3.220.0130.06714.57
5.3.210.0000.08314.58
5.3.200.0030.07014.60
5.3.190.0070.04314.80
5.3.180.0130.03714.70
5.3.170.0130.05714.66
5.3.160.0070.07714.58
5.3.150.0170.03714.59
5.3.140.0030.07714.70
5.3.130.0100.07314.68
5.3.120.0170.06014.53
5.3.110.0100.04714.59
5.3.100.0130.06714.28
5.3.90.0030.08014.28
5.3.80.0070.07714.28
5.3.70.0100.04714.28
5.3.60.0100.07014.28
5.3.50.0100.07014.28
5.3.40.0100.07314.28
5.3.30.0130.05714.28
5.3.20.0070.07714.28
5.3.10.0100.06714.28
5.3.00.0070.07314.28
5.2.170.0100.05014.28
5.2.160.0030.07014.28
5.2.150.0070.06014.28
5.2.140.0030.06314.28
5.2.130.0000.06714.28
5.2.120.0070.06014.28
5.2.110.0070.06014.28
5.2.100.0030.06314.28
5.2.90.0070.04714.28
5.2.80.0030.06314.28
5.2.70.0030.06314.28
5.2.60.0070.06014.28
5.2.50.0070.05714.28
5.2.40.0170.03014.28
5.2.30.0030.06014.28
5.2.20.0030.06714.28
5.2.10.0000.06314.28
5.2.00.0100.05014.28
5.1.60.0100.04714.28
5.1.50.0030.05314.28
5.1.40.0100.04014.28
5.1.30.0130.05014.28
5.1.20.0070.03714.28
5.1.10.0000.05014.28
5.1.00.0030.05714.28
5.0.50.0030.02314.28
5.0.40.0030.04714.28
5.0.30.0070.06714.28
5.0.20.0030.05714.28
5.0.10.0030.04714.28
5.0.00.0070.05714.28
4.4.90.0030.01714.28
4.4.80.0100.03014.28
4.4.70.0000.03314.28
4.4.60.0000.03714.28
4.4.50.0070.03014.28
4.4.40.0030.04314.28
4.4.30.0000.03714.28
4.4.20.0070.03014.28
4.4.10.0030.03714.28
4.4.00.0070.04014.28
4.3.110.0000.02714.28
4.3.100.0030.03314.28
4.3.90.0030.02314.28
4.3.80.0070.05314.28
4.3.70.0000.03014.28
4.3.60.0000.03714.28
4.3.50.0000.03714.28
4.3.40.0070.04314.28
4.3.30.0030.02014.28
4.3.20.0000.02714.28
4.3.10.0030.03314.28
4.3.00.0000.03714.28

preferences:
41.8 ms | 401 KiB | 5 Q