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"); 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.10.0130.00314.94
7.4.00.0060.01314.95
7.3.130.0060.01315.04
7.3.120.0100.01015.14
7.3.110.0040.01415.17
7.3.100.0120.00314.95
7.3.90.0030.01014.71
7.3.80.0000.01614.93
7.3.70.0030.01314.75
7.3.60.0000.00914.91
7.3.50.0030.01314.96
7.3.40.0090.00914.98
7.3.30.0000.01314.98
7.3.20.0030.00616.88
7.3.10.0060.00316.62
7.3.00.0060.00616.90
7.2.260.0100.00615.08
7.2.250.0060.01014.83
7.2.240.0120.00315.20
7.2.230.0030.01214.98
7.2.220.0030.01315.22
7.2.210.0060.01014.90
7.2.200.0040.00414.80
7.2.190.0060.00915.15
7.2.180.0060.00915.18
7.2.170.0030.01015.14
7.2.160.0110.00315.04
7.2.150.0110.00717.04
7.2.140.0110.00416.91
7.2.130.0030.01017.03
7.2.120.0070.00717.20
7.2.110.0060.00317.01
7.2.100.0000.01216.85
7.2.90.0080.00417.12
7.2.80.0100.00717.05
7.2.70.0060.00917.02
7.2.60.0070.00716.75
7.2.50.0040.00416.69
7.2.40.0070.01116.95
7.2.30.0040.01217.13
7.2.20.0060.00816.95
7.2.10.0030.01017.01
7.2.00.0010.01318.26
7.1.330.0090.00615.52
7.1.320.0070.01015.82
7.1.310.0040.01115.87
7.1.300.0080.00415.63
7.1.290.0060.00315.76
7.1.280.0000.01115.90
7.1.270.0040.00815.92
7.1.260.0040.00415.67
7.1.250.0000.01615.88
7.1.240.0060.00615.84
7.1.230.0030.01215.67
7.1.220.0070.00415.77
7.1.210.0030.01015.87
7.1.200.0000.01615.93
7.1.190.0080.00615.86
7.1.180.0030.01515.58
7.1.170.0070.00715.68
7.1.160.0070.00715.86
7.1.150.0070.00715.84
7.1.140.0030.01215.95
7.1.130.0080.00315.95
7.1.120.0090.00615.90
7.1.110.0070.00416.03
7.1.100.0070.00715.73
7.1.90.0070.00415.95
7.1.80.0140.00015.76
7.1.70.0020.00916.54
7.1.60.0050.01517.58
7.1.50.0080.00625.38
7.1.40.0030.00616.04
7.1.30.0030.01415.86
7.1.20.0000.01715.63
7.1.10.0030.01015.81
7.1.00.0050.04219.23
7.0.330.0030.00915.42
7.0.320.0040.00815.43
7.0.310.0110.00415.28
7.0.300.0140.00315.52
7.0.290.0030.01315.39
7.0.280.0070.00715.31
7.0.270.0080.00615.32
7.0.260.0070.01015.57
7.0.250.0060.00615.52
7.0.240.0030.01015.50
7.0.230.0040.01115.49
7.0.220.0070.00415.26
7.0.210.0110.00415.11
7.0.200.0050.00916.04
7.0.190.0110.00315.34
7.0.180.0040.00815.59
7.0.170.0030.01415.51
7.0.160.0040.00415.28
7.0.150.0030.01015.28
7.0.140.0100.03718.74
7.0.130.0080.00015.55
7.0.120.0110.00415.57
7.0.110.0120.00315.59
7.0.100.0070.04517.65
7.0.90.0100.04317.68
7.0.80.0060.05017.60
7.0.70.0080.04617.69
7.0.60.0030.03017.64
7.0.50.0050.02717.93
7.0.40.0020.05216.66
7.0.30.0070.04516.80
7.0.20.0050.04516.73
7.0.10.0020.02716.72
7.0.00.0050.02516.66
5.6.400.0100.00614.19
5.6.390.0070.00714.49
5.6.380.0100.00314.32
5.6.370.0070.00414.32
5.6.360.0060.00614.40
5.6.350.0030.01314.67
5.6.340.0000.01414.43
5.6.330.0090.00014.30
5.6.320.0030.01314.68
5.6.310.0070.00714.43
5.6.300.0060.00614.88
5.6.290.0030.01014.11
5.6.280.0090.03717.81
5.6.270.0070.00714.47
5.6.260.0110.00414.72
5.6.250.0120.03817.53
5.6.240.0080.04517.54
5.6.230.0110.04017.46
5.6.220.0070.03517.53
5.6.210.0060.04817.43
5.6.200.0050.03517.79
5.6.190.0030.02817.82
5.6.180.0110.03017.83
5.6.170.0080.04017.74
5.6.160.0040.02317.65
5.6.150.0030.03217.72
5.6.140.0030.02717.86
5.6.130.0050.02717.75
5.6.120.0120.01817.67
5.6.110.0070.04617.64
5.6.100.0050.02617.77
5.6.90.0050.02417.93
5.6.80.0050.02617.45
5.6.70.0070.03017.34
5.6.60.0050.04617.34
5.6.50.0100.04417.46
5.6.40.0070.04317.33
5.6.30.0080.03617.38
5.6.20.0080.04317.22
5.6.10.0060.04617.28
5.6.00.0090.03817.34
5.5.380.0080.04517.22
5.5.370.0050.04317.48
5.5.360.0090.04217.40
5.5.350.0080.02317.43
5.5.340.0060.02417.43
5.5.330.0120.01717.70
5.5.320.0100.02817.57
5.5.310.0000.03117.62
5.5.300.0030.02617.77
5.5.290.0050.04117.72
5.5.280.0120.03317.52
5.5.270.0050.02417.56
5.5.260.0040.03917.61
5.5.250.0050.02317.40
5.5.240.0050.02317.28
5.5.230.0100.04017.38
5.5.220.0070.03917.34
5.5.210.0020.05117.35
5.5.200.0070.04317.29
5.5.190.0050.04817.15
5.5.180.0050.04517.27
5.5.170.0030.00714.52
5.5.160.0050.04317.25
5.5.150.0030.04417.37
5.5.140.0050.03917.33
5.5.130.0050.04217.26
5.5.120.0100.04217.28
5.5.110.0110.04117.32
5.5.100.0080.04517.30
5.5.90.0090.04217.10
5.5.80.0090.03517.00
5.5.70.0080.04317.26
5.5.60.0100.03817.15
5.5.50.0040.04617.14
5.5.40.0080.04017.15
5.5.30.0170.03317.30
5.5.20.0070.04217.09
5.5.10.0090.03817.29
5.5.00.0050.04417.10
5.4.450.0030.02716.11
5.4.440.0060.02116.11
5.4.430.0070.01816.11
5.4.420.0120.03216.11
5.4.410.0060.01816.10
5.4.400.0060.02015.95
5.4.390.0030.03116.03
5.4.380.0070.03515.87
5.4.370.0100.04016.00
5.4.360.0070.04216.03
5.4.350.0050.04315.88
5.4.340.0080.04115.91
5.4.330.0000.00712.86
5.4.320.0130.03816.01
5.4.310.0070.04216.00
5.4.300.0110.03716.03
5.4.290.0050.04315.95
5.4.280.0100.04016.01
5.4.270.0090.03716.04
5.4.260.0020.04016.01
5.4.250.0030.04515.88
5.4.240.0090.03915.88
5.4.230.0100.03515.96
5.4.220.0050.03716.01
5.4.210.0110.03615.90
5.4.200.0100.03515.94
5.4.190.0020.04415.99
5.4.180.0070.03816.05
5.4.170.0050.04315.90
5.4.160.0050.03715.94
5.4.150.0080.03815.93
5.4.140.0090.03814.71
5.4.130.0020.04614.67
5.4.120.0010.04214.67
5.4.110.0120.03014.65
5.4.100.0050.03714.63
5.4.90.0040.04214.71
5.4.80.0070.03714.61
5.4.70.0100.03014.62
5.4.60.0070.04214.65
5.4.50.0040.03514.63
5.4.40.0060.03614.70
5.4.30.0040.03314.55
5.4.20.0030.04014.63
5.4.10.0030.04114.55
5.4.00.0020.02714.37
5.3.290.0060.03613.78
5.3.280.0090.03513.74
5.3.270.0070.04513.77
5.3.260.0080.04113.79
5.3.250.0050.03913.73
5.3.240.0070.03813.73
5.3.230.0050.03313.73
5.3.220.0060.03813.72
5.3.210.0050.03913.77
5.3.200.0080.03813.71
5.3.190.0020.04613.70
5.3.180.0070.03913.68
5.3.170.0080.03813.74
5.3.160.0100.03913.75
5.3.150.0030.03913.78
5.3.140.0030.03813.70
5.3.130.0080.03513.72
5.3.120.0070.03413.69
5.3.110.0030.04413.71
5.3.100.0020.04413.48
5.3.90.0050.03713.44
5.3.80.0070.03813.41
5.3.70.0100.03513.45
5.3.60.0070.03813.48
5.3.50.0110.03613.45
5.3.40.0060.04013.44
5.3.30.0100.03213.34
5.3.20.0080.03613.27
5.3.10.0050.03813.22
5.3.00.0070.03713.31
5.2.170.0030.06311.09
5.2.160.0000.06711.06
5.2.150.0070.05711.23
5.2.140.0030.06311.28
5.2.130.0070.06311.02
5.2.120.0070.06311.14
5.2.110.0200.05011.17
5.2.100.0070.05711.17
5.2.90.0070.06011.18
5.2.80.0130.06011.15
5.2.70.0130.05711.21
5.2.60.0100.05311.02
5.2.50.0000.06711.10
5.2.40.0100.05310.87
5.2.30.0070.06010.92
5.2.20.0100.05310.91
5.2.10.0070.06010.89
5.2.00.0070.06010.71
5.1.60.0030.05010.55
5.1.50.0070.05010.55
5.1.40.0070.05010.55
5.1.30.0070.05310.55
5.1.20.0100.05310.55
5.1.10.0070.05010.55
5.1.00.0070.05310.55
5.0.50.0070.04310.55
5.0.40.0070.04010.55
5.0.30.0030.05010.55
5.0.20.0030.04310.55
5.0.10.0100.03710.55
5.0.00.0030.06710.55
4.4.90.0070.03310.55
4.4.80.0030.03310.55
4.4.70.0030.03710.55
4.4.60.0030.03010.55
4.4.50.0030.03010.55
4.4.40.0070.05010.55
4.4.30.0030.03310.55
4.4.20.0030.03310.55
4.4.10.0030.03710.55
4.4.00.0030.05710.55
4.3.110.0000.04010.55
4.3.100.0070.03310.55
4.3.90.0100.02710.55
4.3.80.0070.05010.55
4.3.70.0000.03710.55
4.3.60.0070.03010.55
4.3.50.0070.03010.55
4.3.40.0030.05010.55
4.3.30.0070.03010.55
4.3.20.0000.04010.55
4.3.10.0000.03710.55
4.3.00.0000.03710.55

preferences:
44.43 ms | 400 KiB | 5 Q