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 . '\n'; 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.0060.01315.17
7.3.120.0030.01214.98
7.3.110.0100.00614.82
7.3.100.0090.00614.70
7.3.90.0070.00815.06
7.3.80.0070.00915.13
7.3.70.0100.00414.99
7.3.60.0050.00814.89
7.3.50.0020.01314.94
7.3.40.0080.00614.85
7.3.30.0060.01014.99
7.3.20.0070.00716.69
7.3.10.0070.00916.73
7.3.00.0050.00916.66
7.2.250.0070.00715.26
7.2.240.0080.00915.22
7.2.230.0040.01215.34
7.2.220.0100.00815.12
7.2.210.0090.00814.96
7.2.200.0060.00914.93
7.2.190.0070.00915.09
7.2.180.0040.01214.88
7.2.170.0030.01315.00
7.2.160.0140.00315.07
7.2.150.0100.00616.86
7.2.140.0090.00316.84
7.2.130.0130.00016.93
7.2.120.0030.01316.83
7.2.110.0030.01317.10
7.2.100.0030.01316.66
7.2.90.0130.00317.00
7.2.80.0130.00316.98
7.2.70.0060.00617.06
7.2.60.0060.00617.00
7.2.50.0070.00717.09
7.2.40.0000.01617.19
7.2.30.0030.01317.19
7.2.20.0060.00616.77
7.2.10.0130.00317.19
7.2.00.0070.00718.18
7.1.330.0000.01415.97
7.1.320.0060.00915.91
7.1.310.0100.00515.98
7.1.300.0030.01115.82
7.1.290.0080.00815.81
7.1.280.0040.01215.95
7.1.270.0070.00515.76
7.1.260.0070.00715.96
7.1.250.0060.00915.72
7.1.70.0000.01017.10
7.1.60.0130.01019.17
7.1.50.0100.01417.07
7.1.00.0000.07322.46
7.0.200.0000.00816.85
7.0.140.0030.07322.18
7.0.70.0030.08721.80
7.0.60.0030.06321.68
7.0.50.0030.08322.20
7.0.40.0000.08720.11
7.0.30.0130.07320.03
7.0.20.0030.08020.05
7.0.10.0000.08020.09
7.0.00.0200.06320.14
5.6.280.0030.07320.98
5.6.220.0100.08020.50
5.6.210.0100.08020.50
5.6.200.0070.05021.14
5.6.190.0070.08721.13
5.6.180.0000.08721.09
5.6.170.0030.08721.01
5.6.160.0130.06721.02
5.6.150.0070.08021.04
5.6.140.0000.09021.09
5.6.130.0070.06321.02
5.6.120.0000.05021.05
5.6.110.0030.08321.11
5.6.100.0000.08321.01
5.6.90.0030.08720.92
5.6.80.0000.05720.49
5.6.70.0030.05320.48
5.6.60.0070.08320.31
5.6.50.0070.05020.38
5.6.40.0030.08020.54
5.6.30.0030.08320.43
5.6.20.0070.07320.38
5.6.10.0100.06320.44
5.6.00.0000.07720.37
5.5.360.0100.07020.42
5.5.350.0000.08320.48
5.5.340.0030.07320.94
5.5.330.0070.06720.88
5.5.320.0070.08020.93
5.5.310.0100.05020.72
5.5.300.0030.08020.77
5.5.290.0070.08320.93
5.5.280.0100.08320.89
5.5.270.0070.08320.86
5.5.260.0170.06320.80
5.5.250.0030.08720.63
5.5.240.0030.07720.31
5.5.230.0100.07320.03
5.5.220.0000.08320.29
5.5.210.0130.05720.21
5.5.200.0030.07720.17
5.5.190.0070.08020.16
5.5.180.0030.09020.14
5.5.160.0100.06720.28
5.5.150.0030.07320.11
5.5.140.0070.08320.00
5.5.130.0030.07720.25
5.5.120.0030.07320.09
5.5.110.0070.07720.28
5.5.100.0000.08720.18
5.5.90.0000.04720.07
5.5.80.0030.04020.05
5.5.70.0130.07020.05
5.5.60.0030.08320.20
5.5.50.0070.07319.97
5.5.40.0030.08020.07
5.5.30.0030.08319.98
5.5.20.0070.07320.05
5.5.10.0100.07720.06
5.5.00.0100.07319.98
5.4.450.0030.08319.20
5.4.440.0030.08019.37
5.4.430.0100.08019.45
5.4.420.0030.08319.44
5.4.410.0030.08319.14
5.4.400.0000.08019.23
5.4.390.0070.08018.92
5.4.380.0070.07319.16
5.4.370.0030.07318.95
5.4.360.0070.07319.09
5.4.350.0100.07719.13
5.4.340.0100.07319.03
5.4.320.0100.03719.13
5.4.310.0030.06019.13
5.4.300.0100.07319.17
5.4.290.0000.08018.84
5.4.280.0030.07018.90
5.4.270.0070.07719.18
5.4.260.0000.06019.04
5.4.250.0030.07719.04
5.4.240.0070.05319.17
5.4.230.0030.06318.99
5.4.220.0070.07319.03
5.4.210.0100.07019.05
5.4.200.0100.06718.87
5.4.190.0170.06719.20
5.4.180.0100.07019.22
5.4.170.0000.05319.11
5.4.160.0070.07718.92
5.4.150.0030.06719.03
5.4.140.0030.07016.48
5.4.130.0030.07016.47
5.4.120.0030.07016.54
5.4.110.0000.08016.45
5.4.100.0070.07016.49
5.4.90.0030.07016.45
5.4.80.0070.04016.52
5.4.70.0030.05016.54
5.4.60.0030.07316.47
5.4.50.0030.06716.31
5.4.40.0000.07316.53
5.4.30.0070.07016.35
5.4.20.0000.06716.47
5.4.10.0130.06316.47
5.4.00.0030.06715.91
5.3.290.0030.08014.64
5.3.280.0130.05314.53
5.3.270.0070.06714.63
5.3.260.0000.07314.62
5.3.250.0030.07714.73
5.3.240.0030.08014.59
5.3.230.0030.04714.66
5.3.220.0070.06714.63
5.3.210.0070.07714.67
5.3.200.0070.06314.55
5.3.190.0100.07314.61
5.3.180.0000.07714.62
5.3.170.0000.05014.64
5.3.160.0030.06714.55
5.3.150.0130.06014.58
5.3.140.0070.07714.53
5.3.130.0070.07714.61
5.3.120.0000.06014.48
5.3.110.0070.05314.60
5.3.100.0000.05313.98
5.3.90.0030.07314.02
5.3.80.0070.06713.95
5.3.70.0000.05714.08
5.3.60.0100.07014.15
5.3.50.0000.08013.96
5.3.40.0030.07713.93
5.3.30.0000.06014.04
5.3.20.0000.07713.82
5.3.10.0070.07013.73
5.3.00.0030.07313.67
5.2.170.0030.06012.79
5.2.160.0030.06312.79
5.2.150.0030.06012.79
5.2.140.0070.05712.79
5.2.130.0000.05712.79
5.2.120.0030.06012.79
5.2.110.0030.05712.79
5.2.100.0000.06712.79
5.2.90.0070.05712.79
5.2.80.0100.05712.79
5.2.70.0000.06712.79
5.2.60.0000.06712.79
5.2.50.0000.06712.79
5.2.40.0000.04312.79
5.2.30.0070.05712.79
5.2.20.0000.03712.79
5.2.10.0000.06012.79
5.2.00.0000.06712.79
5.1.60.0000.05312.79
5.1.50.0030.05712.79
5.1.40.0000.05712.79
5.1.30.0000.05712.79
5.1.20.0070.05012.79
5.1.10.0030.04012.79
5.1.00.0000.05012.79
5.0.50.0000.05012.79
5.0.40.0030.03312.79
5.0.30.0000.06712.79
5.0.20.0030.03312.79
5.0.10.0030.04312.79
5.0.00.0030.06712.79
4.4.90.0000.02712.79
4.4.80.0000.02712.79
4.4.70.0000.03312.79
4.4.60.0000.02312.79
4.4.50.0000.02712.79
4.4.40.0000.05312.79
4.4.30.0000.03712.79
4.4.20.0000.03712.79
4.4.10.0000.03312.79
4.4.00.0000.03312.79
4.3.110.0000.02312.79
4.3.100.0030.03012.79
4.3.90.0030.03712.79
4.3.80.0000.05712.79
4.3.70.0000.03712.79
4.3.60.0030.03312.79
4.3.50.0000.03312.79
4.3.40.0000.04712.79
4.3.30.0030.03012.79
4.3.20.0000.04012.79
4.3.10.0030.03712.79
4.3.00.0030.03712.79

preferences:
37.94 ms | 401 KiB | 5 Q