3v4l.org

run code in 300+ PHP versions simultaneously
<?php foreach (cartesian(expand_pattern('a..z0..9'), 2) as $option) { echo "$option\n"; } function expand_pattern($pattern) { $bias = 0; $flags = PREG_SET_ORDER | PREG_OFFSET_CAPTURE; preg_match_all('/(.)\.\.(.)/', $pattern, $matches, $flags); foreach ($matches as $match) { $range = implode('', range($match[1][0], $match[2][0])); $pattern = substr_replace( $pattern, $range, $bias + $match[1][1], $match[2][1] - $match[1][1] + 1); $bias += strlen($range) - 4; } return $pattern; } function cartesian($pattern, $length) { $choices = strlen($pattern); $indexes = array_fill(0, $length, 0); $resets = 0; while ($resets != $length) { $result = ''; for ($i = 0; $i < $length; ++$i) { $result .= $pattern[$indexes[$i]]; } yield $result; $resets = 0; for ($i = $length - 1; $i >= 0 && ++$indexes[$i] == $choices; --$i) { $indexes[$i] = 0; ++$resets; } } }

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)
8.3.60.0100.01416.88
8.3.50.0080.01317.82
8.3.40.0140.00319.08
8.3.30.0070.01018.92
8.3.20.0100.00018.85
8.3.10.0090.00020.68
8.3.00.0070.00319.50
8.2.180.0200.01018.54
8.2.170.0200.00722.96
8.2.160.0100.00720.53
8.2.150.0040.00424.18
8.2.140.0060.00324.66
8.2.130.0060.00326.16
8.2.120.0060.00319.73
8.2.110.0040.00721.20
8.2.100.0140.00017.91
8.2.90.0000.00820.45
8.2.80.0030.00719.60
8.2.70.0040.00417.93
8.2.60.0000.00918.28
8.2.50.0050.00518.10
8.2.40.0000.00918.16
8.2.30.0000.01018.07
8.2.20.0000.00917.93
8.2.10.0090.00017.90
8.2.00.0050.00517.86
8.1.280.0130.00725.92
8.1.270.0040.00424.66
8.1.260.0090.00026.35
8.1.250.0030.00628.09
8.1.240.0030.00922.05
8.1.230.0100.00322.73
8.1.220.0090.00017.74
8.1.210.0030.00618.77
8.1.200.0070.00317.50
8.1.190.0030.00617.24
8.1.180.0030.00618.10
8.1.170.0030.00618.72
8.1.160.0060.00318.80
8.1.150.0000.00918.84
8.1.140.0000.00817.68
8.1.130.0050.00217.85
8.1.120.0040.00417.63
8.1.110.0040.00417.61
8.1.100.0030.00517.63
8.1.90.0000.00817.63
8.1.80.0040.00417.53
8.1.70.0060.00317.63
8.1.60.0090.00017.63
8.1.50.0000.00917.60
8.1.40.0000.00917.61
8.1.30.0040.00417.80
8.1.20.0000.00817.80
8.1.10.0000.00817.78
8.1.00.0070.00317.68
8.0.300.0040.00420.08
8.0.290.0000.00816.88
8.0.280.0040.00418.43
8.0.270.0050.00317.18
8.0.260.0040.00417.02
8.0.250.0060.00317.14
8.0.240.0080.00017.08
8.0.230.0080.00017.11
8.0.220.0020.00516.94
8.0.210.0030.00617.06
8.0.200.0040.00417.14
8.0.190.0060.00317.12
8.0.180.0040.00417.05
8.0.170.0080.00017.00
8.0.160.0080.00016.96
8.0.150.0030.00616.99
8.0.140.0030.00916.91
8.0.130.0040.00413.43
8.0.120.0030.00517.02
8.0.110.0040.00417.09
8.0.100.0030.00617.02
8.0.90.0000.00817.09
8.0.80.0130.00716.99
8.0.70.0050.00316.84
8.0.60.0080.00016.98
8.0.50.0030.00617.07
8.0.30.0230.00817.17
8.0.20.0170.01317.24
8.0.10.0000.01117.21
8.0.00.0220.01216.74
7.4.330.0030.00313.20
7.4.320.0040.00416.78
7.4.300.0050.00216.82
7.4.290.0000.00716.73
7.4.280.0060.00316.70
7.4.270.0020.00516.66
7.4.260.0030.00313.57
7.4.250.0030.00616.70
7.4.240.0030.00616.82
7.4.230.0050.00316.80
7.4.220.0130.01016.61
7.4.210.0120.00616.75
7.4.200.0000.00816.86
7.4.190.0000.00816.70
7.4.160.0190.00816.66
7.4.150.0220.00616.97
7.4.140.0170.01316.71
7.4.130.0170.01016.67
7.4.120.0170.01116.66
7.4.110.0140.01016.68
7.4.100.0220.00316.61
7.4.90.0100.01616.59
7.4.80.0170.01619.39
7.4.70.0140.01716.79
7.4.60.0180.01216.77
7.4.50.0000.00616.72
7.4.40.0030.01316.55
7.4.30.0140.01416.64
7.4.00.0100.00615.20
7.3.330.0070.00013.51
7.3.320.0090.00013.53
7.3.310.0050.00316.41
7.3.300.0040.00416.41
7.3.290.0100.01316.52
7.3.280.0090.01416.47
7.3.270.0170.01216.82
7.3.260.0160.01316.82
7.3.250.0150.01216.90
7.3.240.0190.01016.84
7.3.230.0240.00316.76
7.3.210.0140.01216.56
7.3.200.0190.00616.61
7.3.190.0030.02616.85
7.3.180.0090.01416.59
7.3.170.0130.01616.68
7.3.160.0180.00816.74
7.3.120.0030.01315.36
7.2.330.0130.01316.76
7.2.320.0130.01016.70
7.2.310.0170.01217.01
7.2.300.0040.02116.95
7.2.290.0160.00816.89
7.2.60.0070.01016.99
7.2.50.0060.00617.09
7.2.00.0050.00819.71
7.1.200.0000.01415.88
7.1.70.0030.00617.29
7.1.60.0140.01419.40
7.1.50.0070.01717.19
7.1.00.0130.07022.34
7.0.200.0370.00314.79
7.0.140.0030.08021.92
7.0.120.0030.07722.08
7.0.60.0030.08021.68
7.0.50.0130.08017.87
7.0.40.0170.08320.04
7.0.30.0270.06320.08
7.0.20.0330.06320.11
7.0.10.0030.05720.31
7.0.00.0100.08020.08
5.6.280.0030.07721.04
5.6.210.0070.06320.55
5.6.200.0030.07718.14
5.6.190.0100.08720.64
5.6.180.0300.07720.63
5.6.170.0430.06720.46
5.6.160.0030.08320.50
5.6.150.0170.07718.12
5.6.140.0100.07718.14
5.6.130.0030.09018.28
5.6.120.0000.07721.15
5.6.110.0030.04721.04
5.6.100.0030.08721.08
5.6.90.0130.07720.98
5.6.80.0030.06320.52
5.5.350.0070.08020.43
5.5.340.0100.08318.07
5.5.330.0100.04020.27
5.5.320.0270.04020.31
5.5.310.0300.06720.19
5.5.300.0130.07017.92
5.5.290.0100.05718.09
5.5.280.0130.08320.83
5.5.270.0170.07720.80
5.5.260.0070.08320.77
5.5.250.0070.04020.70
5.5.240.0200.03720.36
5.4.450.0070.05019.50
5.4.440.0100.04719.53
5.4.430.0070.04319.52
5.4.420.0030.07319.31
5.4.410.0130.06719.27
5.4.400.0130.06719.09
5.4.390.0100.06719.20
5.4.380.0100.06718.92
5.4.370.0000.07319.00
5.4.360.0000.04319.24
5.4.350.0070.04018.88
5.4.340.0070.06719.15
5.4.320.0100.07019.17
5.4.310.0030.05319.15
5.4.300.0070.08019.16
5.4.290.0070.05718.92
5.4.280.0070.04018.84
5.4.270.0100.07718.95
5.4.260.0000.06718.97
5.4.250.0200.03018.84
5.4.240.0200.06719.24
5.4.230.0030.04019.23
5.4.220.0030.05019.27
5.4.210.0130.07019.23
5.4.200.0030.05019.11
5.4.190.0130.06718.88
5.4.180.0130.07319.11
5.4.170.0130.06019.07
5.4.160.0130.06718.86
5.4.150.0030.04319.14
5.4.140.0130.05716.54
5.4.130.0030.06316.43
5.4.120.0070.06316.55
5.4.110.0030.07316.54
5.4.100.0030.06316.46
5.4.90.0130.05716.45
5.4.80.0000.08316.71
5.4.70.0100.05716.34
5.4.60.0070.07016.37
5.4.50.0070.05316.29
5.4.40.0030.04316.27
5.4.30.0100.04016.38
5.4.20.0030.06016.31
5.4.10.0000.04016.27
5.4.00.0000.04015.95
5.3.290.0170.03714.75
5.3.280.0030.07714.68
5.3.270.0130.06314.68
5.3.260.0100.07314.64
5.3.250.0100.06314.64
5.3.240.0130.06314.65
5.3.230.0070.07714.64
5.3.220.0070.07314.63
5.3.210.0070.07314.57
5.3.200.0170.06014.63
5.3.190.0000.05014.63
5.3.180.0070.06714.73
5.3.170.0130.05714.58
5.3.160.0070.06314.73
5.3.150.0130.07014.46
5.3.140.0130.07714.58
5.3.130.0070.05314.49
5.3.120.0100.07014.48
5.3.110.0000.04314.48
5.3.100.0000.04014.07
5.3.90.0030.08014.07
5.3.80.0030.07714.07
5.3.70.0070.05314.02
5.3.60.0000.07014.06
5.3.50.0070.07714.03
5.3.40.0070.04013.91
5.3.30.0100.04713.96
5.3.20.0070.07313.71
5.3.10.0100.06713.69
5.3.00.0030.06713.61
5.2.170.0030.06711.16
5.2.160.0070.03711.05
5.2.150.0030.06011.21
5.2.140.0030.05311.16
5.2.130.0170.04711.12
5.2.120.0030.05011.27
5.2.110.0000.06011.11
5.2.100.0070.04311.16
5.2.90.0030.06011.08
5.2.80.0070.04710.99
5.2.70.0070.04311.07
5.2.60.0130.04311.21
5.2.50.0130.02711.02
5.2.40.0100.03711.05
5.2.30.0070.04311.05
5.2.20.0030.06311.11
5.2.10.0100.04311.04
5.2.00.0030.04010.77
5.1.60.0000.0579.91
5.1.50.0100.04310.01
5.1.40.0030.03310.14
5.1.30.0030.05710.36
5.1.20.0070.05010.50
5.1.10.0070.05710.10
5.1.00.0030.04010.04
5.0.50.0000.0238.47
5.0.40.0000.0208.39
5.0.30.0030.0338.18
5.0.20.0000.0208.21
5.0.10.0000.0208.24
5.0.00.0100.0308.13
4.4.90.0000.0407.84
4.4.80.0030.0337.84
4.4.70.0000.0237.84
4.4.60.0000.0337.84
4.4.50.0000.0377.84
4.4.40.0030.0537.84
4.4.30.0000.0207.84
4.4.20.0000.0307.84
4.4.10.0000.0207.84
4.4.00.0070.0207.84
4.3.110.0000.0177.84
4.3.100.0000.0177.84
4.3.90.0000.0207.84
4.3.80.0000.0237.84
4.3.70.0100.0077.84
4.3.60.0000.0137.84
4.3.50.0070.0107.84
4.3.40.0000.0277.84
4.3.30.0000.0177.84
4.3.20.0000.0177.84
4.3.10.0000.0137.84
4.3.00.0000.0137.84

preferences:
58.59 ms | 401 KiB | 5 Q