3v4l.org

run code in 300+ PHP versions simultaneously
<?php $original = array ( array ("title" => "one", "color" => "blue" ), array ("title" => "two", "color" => "green" ) ); $merged = array(); $str = "000three000red0!000four000white0!000five000black0!"; $pat = "/\d+(\D+)\d+(\D+)\d!/um"; preg_match($pat, $str, $match); $merged = $original; foreach($match as $result) { $merged[] = array("title" => $match[1], "color" => $match[2]); } print_r($merged);

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.40.0140.00719.14
8.3.30.0030.01419.02
8.3.20.0000.00720.04
8.3.10.0000.00823.48
8.3.00.0000.00820.82
8.2.170.0070.01322.96
8.2.160.0070.00720.34
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0060.00320.85
8.2.110.0060.00322.15
8.2.100.0070.00419.47
8.2.90.0030.00619.30
8.2.80.0040.00417.97
8.2.70.0080.00317.75
8.2.60.0130.00017.90
8.2.50.0080.00618.07
8.2.40.0090.00018.34
8.2.30.0060.00618.52
8.2.20.0060.00317.98
8.2.10.0040.00418.13
8.2.00.0040.00418.12
8.1.270.0040.00423.97
8.1.260.0090.00326.35
8.1.250.0030.00628.09
8.1.240.0070.00324.02
8.1.230.0060.00619.16
8.1.220.0080.00017.91
8.1.210.0050.00318.77
8.1.200.0000.00917.34
8.1.190.0040.00417.47
8.1.180.0050.00218.10
8.1.170.0060.00318.82
8.1.160.0030.00622.09
8.1.150.0040.00418.96
8.1.140.0000.00717.68
8.1.130.0000.00717.86
8.1.120.0000.00717.59
8.1.110.0070.00017.68
8.1.100.0050.00317.55
8.1.90.0000.00717.63
8.1.80.0040.00417.55
8.1.70.0030.00317.63
8.1.60.0040.00417.66
8.1.50.0030.00617.59
8.1.40.0040.00417.71
8.1.30.0040.00417.66
8.1.20.0040.00417.84
8.1.10.0040.00417.73
8.1.00.0100.00017.69
8.0.300.0000.00718.77
8.0.290.0040.00416.88
8.0.280.0030.00318.39
8.0.270.0000.00717.35
8.0.260.0030.00317.27
8.0.250.0000.00717.19
8.0.240.0000.00617.11
8.0.230.0030.00317.15
8.0.220.0000.00717.14
8.0.210.0000.00717.08
8.0.200.0030.00317.02
8.0.190.0040.00417.17
8.0.180.0040.00417.04
8.0.170.0040.00417.12
8.0.160.0030.00417.13
8.0.150.0060.00517.07
8.0.140.0050.00217.04
8.0.130.0060.00013.58
8.0.120.0000.00817.12
8.0.110.0070.00017.08
8.0.100.0000.00817.06
8.0.90.0000.00717.05
8.0.80.0090.00917.11
8.0.70.0070.00017.15
8.0.60.0040.00417.24
8.0.50.0050.00317.19
8.0.30.0130.01017.35
8.0.20.0060.01317.40
8.0.10.0040.00417.09
8.0.00.0100.00716.96
7.4.330.0000.00615.16
7.4.320.0060.00016.80
7.4.300.0030.00316.80
7.4.290.0030.00316.87
7.4.280.0000.00816.92
7.4.270.0000.00816.88
7.4.260.0030.00716.77
7.4.250.0000.00716.71
7.4.240.0020.00616.78
7.4.230.0030.00316.61
7.4.220.0170.00316.83
7.4.210.0060.01116.75
7.4.200.0040.00416.96
7.4.160.0070.00716.58
7.4.150.0180.00017.40
7.4.140.0100.00717.86
7.4.130.0110.00616.70
7.4.120.0030.01516.76
7.4.110.0060.01116.77
7.4.100.0090.00916.66
7.4.90.0000.01816.84
7.4.80.0070.01019.39
7.4.70.0140.00316.80
7.4.60.0110.01116.73
7.4.50.0030.00616.72
7.4.40.0100.00916.73
7.4.30.0110.00416.63
7.4.00.0080.00815.29
7.3.330.0020.00213.46
7.3.320.0050.00213.45
7.3.310.0060.00016.59
7.3.300.0030.00316.57
7.3.290.0100.00316.51
7.3.280.0120.00316.52
7.3.270.0070.01017.40
7.3.260.0160.00316.62
7.3.250.0130.00516.60
7.3.240.0210.00316.82
7.3.230.0100.01016.64
7.3.210.0160.00616.57
7.3.200.0070.01419.39
7.3.190.0100.00716.88
7.3.180.0120.00416.61
7.3.170.0130.00316.69
7.3.160.0140.00316.83
7.3.120.0080.01015.15
7.3.110.0100.00715.03
7.3.100.0140.00414.97
7.3.90.0070.00715.03
7.3.80.0000.01215.07
7.3.70.0050.00514.69
7.3.60.0040.01115.08
7.3.50.0030.00615.08
7.3.40.0030.00914.94
7.3.30.0070.00715.15
7.3.20.0060.00916.95
7.3.10.0030.01216.89
7.3.00.0000.00817.01
7.2.330.0060.01116.80
7.2.320.0100.01316.88
7.2.310.0180.00316.82
7.2.300.0060.00916.77
7.2.290.0110.01116.85
7.2.250.0130.00415.36
7.2.240.0070.01415.46
7.2.230.0130.00315.08
7.2.220.0030.01515.31
7.2.210.0070.01115.25
7.2.200.0120.00315.03
7.2.190.0070.01315.27
7.2.180.0070.00715.34
7.2.170.0150.00315.33
7.2.00.0040.00819.84
7.1.330.0100.00316.23
7.1.320.0040.01116.09
7.1.310.0040.01115.77
7.1.300.0090.00916.05
7.1.290.0040.00716.07
7.1.280.0060.00616.12
7.1.270.0100.00316.21
7.1.260.0060.00615.88
7.1.100.0040.00718.41
7.1.70.0000.00817.58
7.1.60.0100.01419.70
7.1.50.0290.01134.99
7.1.00.0070.07322.30
7.0.200.0030.00516.84
7.0.140.0030.06721.97
7.0.60.0070.03719.94
7.0.50.0100.03317.90
7.0.40.0030.07720.07
7.0.30.0530.08020.32
7.0.20.0330.07320.28
7.0.10.0130.05020.14
7.0.00.0000.05020.25
5.6.280.0030.07320.89
5.6.210.0100.08320.50
5.6.200.0070.08018.29
5.6.190.0170.08320.50
5.6.180.3770.04320.57
5.6.170.0270.07720.39
5.6.160.0170.07320.46
5.6.150.0000.05718.19
5.6.140.0000.04318.10
5.6.130.0100.07318.16
5.6.120.0030.04021.14
5.6.110.0070.08720.98
5.6.100.0070.08321.12
5.6.90.0070.06020.96
5.6.80.0100.08020.51
5.6.70.4170.03720.50
5.5.350.0330.07720.32
5.5.340.0000.05018.08
5.5.330.0130.07320.29
5.5.320.3270.03720.19
5.5.310.0230.05020.34
5.5.300.0070.08017.95
5.5.290.0030.04017.94
5.5.280.0130.07720.79
5.5.270.0030.09020.86
5.5.260.0030.04020.86
5.5.250.0070.07320.68
5.5.240.0200.08020.07
5.4.450.0500.06319.59
5.4.440.0900.06019.38
5.4.430.0270.05019.45
5.4.420.0970.04319.15
5.4.410.0870.05319.33
5.4.400.1130.05719.14
5.4.390.0970.06318.84
5.4.380.0170.05318.74
5.4.370.0100.06318.78
5.4.360.0130.05018.74
5.4.350.0100.06018.72
5.4.340.0070.06018.80
5.4.320.0100.04012.48
5.4.310.0080.04012.48
5.4.300.0060.04212.48
5.4.290.0080.04212.48
5.4.280.0060.04312.38
5.4.270.0100.03712.38
5.4.260.0110.03812.38
5.4.250.0080.03912.38
5.4.240.0080.03612.38
5.4.230.0090.03712.37
5.4.220.0120.03612.37
5.4.210.0070.03912.37
5.4.200.0030.04412.37
5.4.190.0120.05312.36
5.4.180.0120.04812.36
5.4.170.0060.04712.38
5.4.160.0090.03612.38
5.4.150.0050.04112.37
5.4.140.0080.03712.05
5.4.130.0070.03712.04
5.4.120.0060.03612.00
5.4.110.0040.04012.00
5.4.100.0080.03411.99
5.4.90.0060.03911.99
5.4.80.0060.03912.00
5.4.70.0090.04811.99
5.4.60.0090.03511.99
5.4.50.0090.03411.99
5.4.40.0050.03711.98
5.4.30.0170.03511.98
5.4.20.0110.04111.98
5.4.10.0120.03711.98
5.4.00.0080.03711.47
5.3.290.0050.04012.80
5.3.280.0080.03912.71
5.3.270.0160.04412.73
5.3.260.0070.03912.72
5.3.250.0070.03812.72
5.3.240.0110.03412.72
5.3.230.0100.03612.71
5.3.220.0060.03912.68
5.3.210.0040.04312.68
5.3.200.0090.03712.68
5.3.190.0050.04112.67
5.3.180.0090.03912.67
5.3.170.0100.04012.67
5.3.160.0120.04212.67
5.3.150.0090.04812.68
5.3.140.0090.03812.66
5.3.130.0080.03912.66
5.3.120.0100.04212.66
5.3.110.0100.04212.66
5.3.100.0090.03512.12
5.3.90.0040.03812.10
5.3.80.0060.03712.09
5.3.70.0070.03812.09
5.3.60.0110.03512.07
5.3.50.0090.03812.03
5.3.40.0080.03612.03
5.3.30.0070.03511.98
5.3.20.0070.03411.77
5.3.10.0060.03411.73
5.3.00.0070.04311.72
5.2.170.0080.0279.22
5.2.160.0050.0309.22
5.2.150.0060.0309.21
5.2.140.0070.0299.21
5.2.130.0030.0319.18
5.2.120.0050.0299.18
5.2.110.0070.0289.18
5.2.100.0030.0319.18
5.2.90.0070.0279.18
5.2.80.0060.0349.18
5.2.70.0040.0369.18
5.2.60.0080.0319.13
5.2.50.0070.0299.10
5.2.40.0040.0319.08
5.2.30.0070.0309.05
5.2.20.0070.0269.05
5.2.10.0030.0308.94
5.2.00.0090.0288.80
5.1.60.0050.0268.07
5.1.50.0070.0288.06
5.1.40.0050.0348.04
5.1.30.0080.0348.39
5.1.20.0110.0328.41
5.1.10.0100.0258.14
5.1.00.0060.0258.14
5.0.50.0030.0226.62
5.0.40.0070.0176.48
5.0.30.0040.0336.29
5.0.20.0020.0226.26
5.0.10.0030.0226.24
5.0.00.0060.0316.23
4.4.90.0030.0184.78
4.4.80.0020.0184.75
4.4.70.0050.0144.76
4.4.60.0040.0154.75
4.4.50.0030.0164.77
4.4.40.0030.0264.71
4.4.30.0050.0144.76
4.4.20.0030.0164.85
4.4.10.0040.0174.85
4.4.00.0060.0284.76
4.3.110.0050.0164.67
4.3.100.0070.0174.66
4.3.90.0030.0164.64
4.3.80.0040.0254.58
4.3.70.0050.0154.63
4.3.60.0040.0144.63
4.3.50.0040.0224.62
4.3.40.0080.0304.54
4.3.30.0020.0233.29
4.3.20.0010.0233.26
4.3.10.0020.0213.22
4.3.00.0030.01728.29

preferences:
41.36 ms | 400 KiB | 5 Q