3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = ['foo' => [5 => 'bar', 10 => 'baz']]; $match = 'foo.{key}.bar'; $pattern = '/'.preg_replace('/\{(\w+?)\}/', '(.+)', str_replace('.', '\.', $match)).'/'; if (preg_match($pattern, $match, $matches)) { var_dump($matches); }

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.0200.00018.68
8.3.50.0100.00922.01
8.3.40.0100.01019.05
8.3.30.0070.01418.97
8.3.20.0050.00319.91
8.3.10.0040.00422.04
8.3.00.0040.00422.44
8.2.180.0040.01516.36
8.2.170.0150.00422.96
8.2.160.0070.00720.95
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0040.00419.61
8.2.110.0000.00822.14
8.2.100.0090.00617.79
8.2.90.0060.00319.23
8.2.80.0030.00617.97
8.2.70.0030.00617.63
8.2.60.0000.00817.80
8.2.50.0040.00418.07
8.2.40.0080.00018.16
8.2.30.0050.00318.19
8.2.20.0080.00017.68
8.2.10.0030.00617.93
8.2.00.0040.00417.75
8.1.280.0180.00325.92
8.1.270.0090.00022.11
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0040.00423.80
8.1.230.0060.00618.96
8.1.220.0000.00817.74
8.1.210.0050.00318.77
8.1.200.0060.00317.48
8.1.190.0040.00417.51
8.1.180.0040.00418.10
8.1.170.0000.00818.53
8.1.160.0080.00021.91
8.1.150.0080.00018.77
8.1.140.0040.00417.59
8.1.130.0070.00017.87
8.1.120.0040.00417.62
8.1.110.0000.00717.48
8.1.100.0050.00217.61
8.1.90.0030.00517.48
8.1.80.0070.00017.60
8.1.70.0000.00717.50
8.1.60.0030.00617.66
8.1.50.0040.00417.68
8.1.40.0000.01017.64
8.1.30.0040.00417.73
8.1.20.0050.00317.77
8.1.10.0030.00517.66
8.1.00.0030.00717.55
8.0.300.0000.00818.77
8.0.290.0070.00017.05
8.0.280.0030.00318.46
8.0.270.0000.00717.34
8.0.260.0040.00416.84
8.0.250.0030.00317.08
8.0.240.0100.00017.10
8.0.230.0080.00017.10
8.0.220.0000.00717.02
8.0.210.0000.00717.03
8.0.200.0000.00717.06
8.0.190.0050.00217.09
8.0.180.0000.00717.07
8.0.170.0030.00517.05
8.0.160.0040.00416.85
8.0.150.0040.00416.98
8.0.140.0040.00416.88
8.0.130.0030.00313.42
8.0.120.0030.00617.05
8.0.110.0040.00417.01
8.0.100.0000.00716.93
8.0.90.0080.00017.03
8.0.80.0030.01517.09
8.0.70.0000.00817.03
8.0.60.0060.00316.97
8.0.50.0000.00716.80
8.0.30.0160.00617.51
8.0.20.0070.01517.45
8.0.10.0060.00317.10
8.0.00.0130.00516.91
7.4.330.0000.00615.04
7.4.320.0000.00616.66
7.4.300.0000.00616.66
7.4.290.0070.00016.68
7.4.280.0030.00516.64
7.4.270.0060.00316.55
7.4.260.0120.00016.59
7.4.250.0040.00416.66
7.4.240.0040.00316.77
7.4.230.0000.00716.56
7.4.220.0070.01116.82
7.4.210.0070.01116.74
7.4.200.0000.00716.65
7.4.190.0000.00716.60
7.4.160.0080.01316.66
7.4.150.0040.01517.40
7.4.140.0050.01917.86
7.4.130.0150.00616.60
7.4.120.0120.00816.79
7.4.110.0090.00816.46
7.4.100.0060.01616.83
7.4.90.0170.00016.74
7.4.80.0090.00919.39
7.4.70.0100.01016.70
7.4.60.0030.02016.62
7.4.50.0040.00416.61
7.4.40.0070.01022.77
7.4.30.0090.00816.70
7.4.00.0090.00615.09
7.3.330.0000.00513.09
7.3.320.0020.00213.14
7.3.310.0000.00716.19
7.3.300.0070.00016.19
7.3.290.0030.01116.34
7.3.280.0100.00516.33
7.3.270.0160.00317.40
7.3.260.0100.00716.36
7.3.250.0080.00916.38
7.3.240.0130.00616.47
7.3.230.0030.01516.44
7.3.210.0110.00716.32
7.3.200.0180.00516.70
7.3.190.0100.00716.46
7.3.180.0160.00016.55
7.3.170.0090.00916.64
7.3.160.0060.00916.36
7.3.120.0100.00314.96
7.2.330.0100.01316.68
7.2.320.0090.01116.60
7.2.310.0100.00716.56
7.2.300.0140.00316.62
7.2.290.0100.01016.71
7.2.60.0060.00616.80
7.2.00.0030.01019.38
7.1.200.0030.00715.86
7.1.100.0030.01018.48
7.1.70.0060.00617.25
7.1.60.0040.01119.82
7.1.50.0040.02117.07
7.1.00.0000.08022.34
7.0.200.0070.00016.69
7.0.140.0000.07722.10
7.0.60.0100.07020.00
7.0.50.0030.04717.80
7.0.40.0130.08020.06
7.0.30.0200.04320.15
7.0.20.0370.07720.22
7.0.10.0300.08020.10
7.0.00.0100.08020.18
5.6.280.0000.07721.10
5.6.210.0130.04320.62
5.6.200.0100.07318.12
5.6.190.0030.04720.41
5.6.180.0270.08020.38
5.6.170.0170.04720.50
5.6.160.0070.08320.40
5.6.150.0070.08318.11
5.6.140.0070.07718.11
5.6.130.0100.07718.12
5.6.120.0000.05721.02
5.6.110.0170.08021.11
5.6.100.0030.05020.98
5.6.90.0070.05021.09
5.6.80.0170.07320.43
5.6.70.3500.03320.41
5.5.350.0370.07020.32
5.5.340.0030.06018.00
5.5.330.0000.04320.46
5.5.320.0070.04720.07
5.5.310.0330.05020.27
5.5.300.0000.05318.03
5.5.290.0130.08017.91
5.5.280.0100.03320.87
5.5.270.0030.06720.86
5.5.260.0100.05720.79
5.5.250.0170.07720.61
5.5.240.0030.06320.26
5.4.450.0170.06019.53
5.4.440.0230.05719.63
5.4.430.0130.06319.63
5.4.420.0200.04719.48
5.4.410.0030.06718.68
5.4.400.0430.05018.75
5.4.390.0500.06718.67
5.4.380.0200.05718.72
5.4.370.0100.04318.46
5.4.360.0130.04718.57
5.4.350.0070.03311.97
5.4.340.0080.03211.97
5.4.320.0050.04212.45
5.4.310.0090.03512.45
5.4.300.0040.03912.46
5.4.290.0080.04212.45
5.4.280.0060.03512.35
5.4.270.0170.05719.04
5.4.260.0200.05018.80
5.4.250.0170.05018.75
5.4.240.0130.05718.77
5.4.230.0100.07018.89
5.4.220.0170.05019.00
5.4.210.0030.05718.92
5.4.200.0070.06318.84
5.4.190.0130.05019.03
5.4.180.0130.04718.74
5.4.170.0200.06718.99
5.4.160.0100.05718.76
5.4.150.0200.07018.87
5.4.140.0070.08016.27
5.4.130.0230.06016.50
5.4.120.0030.08016.28
5.4.110.0200.05716.35
5.4.100.0030.05716.41
5.4.90.0030.05316.49
5.4.80.0130.05316.39
5.4.70.0100.04716.38
5.4.60.0070.05316.40
5.4.50.0200.05716.50
5.4.40.0100.05016.38
5.4.30.0130.05716.49
5.4.20.0100.05316.25
5.4.10.0170.04716.26
5.4.00.0070.05315.70
5.3.290.0060.03912.80
5.3.280.0170.04714.47
5.3.270.0030.06314.62
5.3.260.0200.06714.45
5.3.250.0170.06014.63
5.3.240.0070.07714.49
5.3.230.0130.07014.47
5.3.220.0070.05714.58
5.3.210.0130.07314.43
5.3.200.0070.05014.58
5.3.190.0030.05714.44
5.3.180.0070.05014.33
5.3.170.0100.04714.45
5.3.160.0070.04714.66
5.3.150.0130.04714.55
5.3.140.0070.08014.60
5.3.130.0070.05714.55
5.3.120.0100.05014.42
5.3.110.0170.04714.42
5.3.100.0030.05313.92
5.3.90.0170.04714.11
5.3.80.0070.05314.03
5.3.70.0130.06713.79
5.3.60.0200.04014.01
5.3.50.0170.04714.10
5.3.40.0100.06314.04
5.3.30.0170.04313.85
5.3.20.0070.07013.53
5.3.10.0100.05013.67
5.3.00.0130.04313.58
5.2.170.0100.04311.23
5.2.160.0100.03711.15
5.2.150.0070.04311.16
5.2.140.0100.06011.16
5.2.130.0100.03711.20
5.2.120.0100.03710.98
5.2.110.0100.05311.20
5.2.100.0030.05311.25
5.2.90.0100.05311.02
5.2.80.0070.04010.84
5.2.70.0100.04711.10
5.2.60.0070.04710.89
5.2.50.0170.04010.95
5.2.40.0070.05311.00
5.2.30.0130.04310.91
5.2.20.0030.06010.84
5.2.10.0100.03710.77
5.2.00.0070.05310.47
5.1.60.0030.04310.08
5.1.50.0070.04310.08
5.1.40.0070.0339.93
5.1.30.0030.05010.35
5.1.20.0100.04710.43
5.1.10.0100.04010.15
5.1.00.0100.05310.11
5.0.50.0070.0308.59
5.0.40.0100.0208.33
5.0.30.0100.0378.41
5.0.20.0000.0308.15
5.0.10.0000.0308.12
5.0.00.0000.0478.19
4.4.90.0030.0277.59
4.4.80.0030.0237.59
4.4.70.0000.0337.59
4.4.60.0000.0237.59
4.4.50.0070.0277.58
4.4.40.0030.0437.59
4.4.30.0030.0237.59
4.4.20.0100.0307.59
4.4.10.0030.0277.59
4.4.00.0000.0377.59
4.3.110.0100.0237.59
4.3.100.0130.0107.59
4.3.90.0000.0237.59
4.3.80.0070.0337.59
4.3.70.0030.0207.59
4.3.60.0000.0207.59
4.3.50.0030.0207.59
4.3.40.0070.0307.59
4.3.30.0030.0307.59
4.3.20.0000.0277.59
4.3.10.0000.0277.59
4.3.00.0030.0306.69

preferences:
35.19 ms | 401 KiB | 5 Q