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"); 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.0000.01615.05
7.3.120.0110.00514.81
7.3.110.0090.00614.89
7.3.100.0090.00714.92
7.3.90.0070.00614.80
7.3.80.0040.00814.79
7.3.70.0070.00714.58
7.3.60.0030.01214.87
7.3.50.0080.00814.87
7.3.40.0070.00714.78
7.3.30.0020.01214.90
7.3.20.0030.01016.78
7.3.10.0110.00516.69
7.3.00.0040.01216.71
7.2.250.0110.00815.23
7.2.240.0050.01515.13
7.2.230.0040.01114.98
7.2.220.0030.00715.00
7.2.210.0090.00314.94
7.2.200.0050.00815.13
7.2.190.0040.01014.89
7.2.180.0080.00814.83
7.2.170.0030.01315.14
7.2.160.0030.00715.20
7.2.150.0030.01216.95
7.2.140.0070.01016.93
7.2.130.0070.00716.82
7.2.120.0030.00616.91
7.2.110.0060.00617.04
7.2.100.0040.01116.89
7.2.90.0040.00816.96
7.2.80.0030.01416.80
7.2.70.0030.01316.58
7.2.60.0070.00716.88
7.2.50.0040.01116.90
7.2.40.0090.00617.03
7.2.30.0080.00816.64
7.2.20.0000.01716.84
7.2.10.0100.00316.84
7.2.00.0020.01518.17
7.1.330.0100.00515.89
7.1.320.0070.00715.83
7.1.310.0050.00915.67
7.1.300.0090.00515.66
7.1.290.0100.00515.72
7.1.280.0090.00415.69
7.1.270.0060.00615.85
7.1.260.0060.00815.65
7.1.250.0040.01115.68
7.1.70.0040.01117.30
7.1.60.0120.00319.40
7.1.50.0060.00616.96
7.1.00.0070.05722.41
7.0.200.0340.01014.68
7.0.140.0070.06722.08
7.0.120.0030.07722.16
7.0.60.0000.08719.93
7.0.50.0030.08717.87
7.0.40.0070.04320.11
7.0.30.0530.05020.11
7.0.20.0230.08020.12
7.0.10.0370.08320.09
7.0.00.0070.09020.23
5.6.280.0070.07021.11
5.6.210.0130.07320.47
5.6.200.0000.07318.29
5.6.190.0030.08320.52
5.6.180.4170.03320.59
5.6.170.0270.05320.71
5.6.160.0030.04720.44
5.6.150.0030.04318.29
5.6.140.0030.08718.24
5.6.130.0070.08018.14
5.6.120.0070.04321.10
5.6.110.0070.09020.99
5.6.100.0070.08321.15
5.6.90.0100.06320.98
5.6.80.0070.07320.36
5.6.70.0270.07720.53
5.5.350.0200.08020.34
5.5.340.0070.04017.96
5.5.330.0030.04020.28
5.5.320.0700.06020.43
5.5.310.0200.07320.30
5.5.300.0070.04018.03
5.5.290.0030.04017.92
5.5.280.0030.04320.80
5.5.270.0130.07720.80
5.5.260.0170.07720.82
5.5.250.0100.03720.80
5.5.240.0000.04320.24
5.4.450.0030.08719.25
5.4.440.0100.07719.18
5.4.430.0200.07019.48
5.4.420.0130.07319.42
5.4.410.0100.07319.43
5.4.400.0030.05718.89
5.4.390.0170.07319.15
5.4.380.0070.06718.87
5.4.370.0030.06319.16
5.4.360.0200.06719.07
5.4.350.0070.05718.86
5.4.340.0100.05019.20
5.4.320.0070.07319.24
5.4.310.0100.07019.25
5.4.300.0030.04019.15
5.4.290.0130.07319.24
5.4.280.0130.05719.17
5.4.270.0030.08019.25
5.4.260.0070.07719.20
5.4.250.0100.07718.92
5.4.240.0070.07719.24
5.4.230.0070.07018.97
5.4.220.0100.07318.85
5.4.210.0170.03319.15
5.4.200.0030.03719.11
5.4.190.0000.04018.88
5.4.180.0000.04019.22
5.4.170.0100.04019.14
5.4.160.0030.03719.15
5.4.150.0030.04719.14
5.4.140.0070.03316.32
5.4.130.0030.03316.46
5.4.120.0070.04016.51
5.4.110.0030.03716.42
5.4.100.0000.03716.51
5.4.90.0000.06016.49
5.4.80.0000.03716.46
5.4.70.0030.03316.46
5.4.60.0030.03316.25
5.4.50.0030.03716.28
5.4.40.0000.03716.64
5.4.30.0030.03716.38
5.4.20.0000.03716.27
5.4.10.0030.03716.30
5.4.00.0070.03015.95
5.3.290.0000.05314.66
5.3.280.0100.07314.52
5.3.270.0000.04014.63
5.3.260.0030.04314.66
5.3.250.0130.02714.61
5.3.240.0030.04714.77
5.3.230.0000.05314.57
5.3.220.0030.04014.72
5.3.210.0000.04014.62
5.3.200.0070.03314.64
5.3.190.0130.02714.58
5.3.180.0000.04014.56
5.3.170.0070.03714.62
5.3.160.0030.03714.63
5.3.150.0070.03714.71
5.3.140.0070.03714.59
5.3.130.0070.03314.61
5.3.120.0100.03714.54
5.3.110.0070.03714.56
5.3.100.0030.03714.05
5.3.90.0070.03014.03
5.3.80.0030.03714.17
5.3.70.0000.03713.94
5.3.60.0030.03314.02
5.3.50.0000.04014.00
5.3.40.0030.04013.96
5.3.30.0030.04313.97
5.3.20.0030.04013.72
5.3.10.0000.04313.82
5.3.00.0100.07313.54
5.2.170.0000.03011.20
5.2.160.0070.02311.15
5.2.150.0030.02711.20
5.2.140.0030.06011.22
5.2.130.0000.03711.02
5.2.120.0100.05711.11
5.2.110.0000.03311.11
5.2.100.0100.03311.11
5.2.90.0030.06311.03
5.2.80.0070.05011.06
5.2.70.0030.04011.07
5.2.60.0000.03311.14
5.2.50.0030.04710.95
5.2.40.0070.06011.02
5.2.30.0030.05710.98
5.2.20.0130.05310.96
5.2.10.0030.06310.91
5.2.00.0130.05010.76
5.1.60.0000.02710.05
5.1.50.0100.03310.06
5.1.40.0030.04310.00
5.1.30.0000.03010.36
5.1.20.0070.05010.33
5.1.10.0070.05710.08
5.1.00.0030.05710.21
5.0.50.0000.0408.52
5.0.40.0100.0378.44
5.0.30.0000.0678.28
5.0.20.0030.0478.28
5.0.10.0030.0408.32
5.0.00.0030.0678.28
4.4.90.0030.0378.28
4.4.80.0000.0208.28
4.4.70.0030.0308.28
4.4.60.0070.0238.28
4.4.50.0000.0208.28
4.4.40.0030.0478.28
4.4.30.0000.0178.28
4.4.20.0000.0208.28
4.4.10.0030.0308.28
4.4.00.0000.0438.28
4.3.110.0030.0378.28
4.3.100.0000.0378.28
4.3.90.0000.0338.28
4.3.80.0030.0438.28
4.3.70.0000.0208.28
4.3.60.0070.0338.28
4.3.50.0030.0278.28
4.3.40.0000.0538.28
4.3.30.0030.0338.28
4.3.20.0000.0238.28
4.3.10.0000.0378.28
4.3.00.0030.0308.28

preferences:
47.07 ms | 401 KiB | 5 Q