3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "some text here [baz] and here [you|him|her|foo|bar|baz|foo|option|test] and even here [another]."; // Capture strings between brackets preg_match_all('~\[([^]]+)]~', $string, $matches); $groups = []; foreach ($matches[1] as $values) { // Explode them on pipe $groups[] = explode('|', $values); } print_r($groups);

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.5.10.0090.00720.25
8.5.00.0150.00820.34
8.4.160.0140.00723.83
8.4.150.0030.00014.05
8.4.140.0130.00718.00
8.4.130.0140.00717.95
8.4.120.0100.01020.27
8.4.110.0110.01022.21
8.4.100.0070.00520.82
8.4.90.0120.00718.93
8.4.80.0050.00418.82
8.4.70.0110.00818.39
8.4.60.0140.00718.91
8.4.50.0120.01019.64
8.4.40.0170.00321.41
8.4.30.0100.01017.67
8.4.20.0080.01117.88
8.4.10.0100.00720.27
8.3.280.0150.00718.63
8.3.270.0140.00816.90
8.3.260.0090.01116.89
8.3.250.0120.00818.94
8.3.240.0120.00617.31
8.3.230.0120.00816.91
8.3.220.0100.00819.22
8.3.210.0100.00916.72
8.3.200.0040.00516.75
8.3.190.0090.00917.15
8.3.180.0100.00518.42
8.3.170.0040.01118.84
8.3.160.0110.00717.36
8.3.150.0120.00620.84
8.3.140.0000.00818.98
8.3.130.0030.00518.55
8.3.120.0050.00319.01
8.3.110.0090.00020.94
8.3.100.0080.00024.06
8.3.90.0190.00026.77
8.3.80.0060.00317.97
8.3.70.0040.01116.50
8.3.60.0060.01216.71
8.3.50.0140.00722.21
8.3.40.0040.01118.92
8.3.30.0070.00718.98
8.3.20.0030.00619.07
8.3.10.0080.00023.66
8.3.00.0040.00420.52
8.2.290.0110.00820.53
8.2.280.0140.00618.79
8.2.270.0070.00717.41
8.2.260.0070.01116.61
8.2.250.0050.00316.83
8.2.240.0030.00618.83
8.2.230.0040.00422.58
8.2.220.0160.00337.54
8.2.210.0090.00326.77
8.2.200.0060.00316.63
8.2.190.0170.00317.00
8.2.180.0110.00716.63
8.2.170.0120.00622.96
8.2.160.0120.00321.09
8.2.150.0090.00024.18
8.2.140.0080.00024.66
8.2.130.0080.00022.27
8.2.120.0050.00326.35
8.2.110.0030.00622.15
8.2.100.0040.00818.16
8.2.90.0050.00318.00
8.2.80.0030.00718.98
8.2.70.0050.00517.63
8.2.60.0000.00817.93
8.2.50.0040.00418.07
8.2.40.0030.00519.91
8.2.30.0040.00417.98
8.2.20.0040.00417.95
8.2.10.0000.00918.10
8.2.00.0000.00718.01
8.1.330.0120.00722.22
8.1.320.0030.00516.41
8.1.310.0110.00718.52
8.1.300.0110.00720.28
8.1.290.0090.00030.84
8.1.280.0070.01125.92
8.1.270.0040.00422.11
8.1.260.0080.00028.09
8.1.250.0070.00028.09
8.1.240.0000.00823.79
8.1.230.0070.00419.09
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0000.01017.48
8.1.190.0000.00917.25
8.1.180.0060.00318.10
8.1.170.0030.00518.90
8.1.160.0000.00719.07
8.1.150.0000.00718.93
8.1.140.0070.00018.88
8.1.130.0040.00417.65
8.1.120.0040.00417.56
8.1.110.0000.00717.66
8.1.100.0040.00417.53
8.1.90.0000.00717.63
8.1.80.0050.00217.59
8.1.70.0000.00817.49
8.1.60.0090.00417.71
8.1.50.0030.00617.64
8.1.40.0040.00417.75
8.1.30.0030.00517.71
8.1.20.0080.00017.67
8.1.10.0030.00517.77
8.1.00.0000.00717.70
8.0.300.0070.00019.77
8.0.290.0040.00416.75
8.0.280.0030.00318.57
8.0.270.0000.00818.04
8.0.260.0000.00716.88
8.0.250.0070.00017.00
8.0.240.0030.00317.01
8.0.230.0030.00417.15
8.0.220.0040.00317.10
8.0.210.0000.00717.01
8.0.200.0030.00316.95
8.0.190.0030.00317.12
8.0.180.0000.00716.97
8.0.170.0080.00017.08
8.0.160.0070.00016.93
8.0.150.0070.00017.04
8.0.140.0040.00417.02
8.0.130.0040.00413.46
8.0.120.0060.00316.92
8.0.110.0040.00416.85
8.0.100.0040.00416.88
8.0.90.0000.00717.06
8.0.80.0080.00817.12
8.0.70.0050.00217.09
8.0.60.0000.00717.14
8.0.50.0040.00417.03
8.0.30.0090.00817.04
8.0.20.0140.00517.40
8.0.10.0050.00317.05
8.0.00.0090.00916.80
7.4.330.0000.00615.16
7.4.320.0070.00016.72
7.4.300.0030.00316.63
7.4.290.0000.00716.80
7.4.280.0070.00016.78
7.4.270.0040.00416.73
7.4.260.0030.00316.75
7.4.250.0040.00416.62
7.4.240.0030.00316.72
7.4.230.0030.00316.73
7.4.220.0100.00716.70
7.4.210.0060.00916.73
7.4.200.0000.00716.79
7.4.160.0070.01116.83
7.4.150.0120.00617.40
7.4.140.0080.01117.86
7.4.130.0080.00916.65
7.4.120.0090.00816.68
7.4.110.0120.00616.48
7.4.100.0060.01016.80
7.4.90.0120.00616.61
7.4.80.0140.00219.39
7.4.70.0080.00816.58
7.4.60.0100.00716.58
7.4.50.0070.01016.57
7.4.40.0100.00716.71
7.4.30.0170.00316.69
7.4.00.0030.01415.05
7.3.330.0050.00013.33
7.3.320.0050.00013.26
7.3.310.0030.00316.34
7.3.300.0040.00416.46
7.3.290.0050.01116.32
7.3.280.0100.00916.34
7.3.270.0040.01617.40
7.3.260.0130.00716.71
7.3.250.0130.00516.57
7.3.240.0110.00716.71
7.3.230.0070.01016.75
7.3.210.0140.00316.58
7.3.200.0120.00316.40
7.3.190.0130.00316.48
7.3.180.0100.01316.62
7.3.170.0070.01316.45
7.3.160.0150.00716.63
7.3.120.0050.00915.18
7.3.110.0060.01314.94
7.3.100.0140.00414.98
7.3.90.0080.00815.14
7.3.80.0000.01415.20
7.3.70.0000.01114.95
7.3.60.0000.01415.01
7.3.50.0100.00315.05
7.3.40.0040.00414.84
7.3.30.0100.00714.96
7.3.20.0000.01316.75
7.3.10.0000.01116.71
7.3.00.0030.01016.59
7.2.330.0110.00716.66
7.2.320.0070.01316.74
7.2.310.0040.01216.89
7.2.300.0100.00716.84
7.2.290.0080.01316.88
7.2.250.0030.01615.16
7.2.240.0070.01315.33
7.2.230.0040.01415.20
7.2.220.0000.01615.27
7.2.210.0060.01015.14
7.2.200.0070.00715.28
7.2.190.0030.01614.96
7.2.180.0030.00715.31
7.2.170.0030.00715.26
7.2.160.0070.00715.42
7.2.150.0030.00917.09
7.2.140.0120.00317.16
7.2.130.0100.00317.05
7.2.120.0090.00617.09
7.2.110.0060.00816.95
7.2.100.0000.01417.20
7.2.90.0040.01117.28
7.2.80.0030.00917.18
7.2.70.0070.01017.21
7.2.60.0090.00217.23
7.2.50.0030.00917.27
7.2.40.0000.01617.05
7.2.30.0000.01317.23
7.2.20.0070.00716.98
7.2.10.0100.00317.20
7.2.00.0040.01217.00
7.1.330.0100.01015.70
7.1.320.0070.00716.21
7.1.310.0100.00016.01
7.1.300.0030.01016.15
7.1.290.0080.00416.12
7.1.280.0060.00615.83
7.1.270.0060.00615.97
7.1.260.0070.00715.83
7.1.250.0110.00316.06
7.1.240.0090.00316.00
7.1.230.0040.00915.65
7.1.220.0030.00615.80
7.1.210.0080.00415.84
7.1.200.0030.01015.87
7.1.190.0040.00716.02
7.1.180.0030.00716.11
7.1.170.0070.00416.11
7.1.160.0030.00715.77
7.1.150.0090.00315.95
7.1.140.0040.00715.95
7.1.130.0080.00015.93
7.1.120.0000.01315.75
7.1.110.0070.00316.03
7.1.100.0030.00815.97
7.1.90.0080.00015.96
7.1.80.0070.00715.92
7.1.70.0050.00916.54
7.1.60.0160.00216.72
7.1.50.0090.00616.05
7.1.40.0110.00415.68
7.1.30.0090.00016.04
7.1.20.0060.00615.88
7.1.10.0070.00715.82
7.1.00.0040.04619.13
7.0.330.0080.00415.52
7.0.320.0060.00615.51
7.0.310.0090.00315.64
7.0.300.0040.00715.49
7.0.290.0120.00015.45
7.0.280.0000.01115.48
7.0.270.0040.01115.66
7.0.260.0070.00715.64
7.0.250.0160.00015.60
7.0.240.0030.01015.68
7.0.230.0070.00715.64
7.0.220.0060.00915.64
7.0.210.0130.00315.63
7.0.200.0060.00716.21
7.0.190.0060.00615.74
7.0.180.0090.00915.40
7.0.170.0190.00015.79
7.0.160.0060.00915.54
7.0.150.0070.01015.62
7.0.140.0070.01015.79
7.0.130.0060.01215.61
7.0.120.0070.00615.73
7.0.110.0060.00615.72
7.0.100.0430.03317.61
7.0.90.0530.03017.73
7.0.80.0050.03317.79
7.0.70.0110.03117.58
7.0.60.0100.03017.79
7.0.50.0100.03017.92
7.0.40.0090.03116.99
7.0.30.0140.02816.97
7.0.20.0080.03517.06
7.0.10.0050.03717.04
7.0.00.0130.04117.01
5.6.400.0070.00714.68
5.6.390.0070.01114.62
5.6.380.0040.01114.56
5.6.370.0100.00314.77
5.6.360.0040.00814.25
5.6.350.0000.01014.25
5.6.340.0000.00914.64
5.6.330.0040.00414.32
5.6.320.0000.00914.28
5.6.310.0060.00614.29
5.6.300.0100.00314.43
5.6.290.0130.00314.47
5.6.280.0070.00314.69
5.6.270.0070.00714.47
5.6.260.0030.00914.74
5.6.250.0090.03017.67
5.6.240.0030.03817.52
5.6.230.0070.03217.42
5.6.220.0080.03117.47
5.6.210.0080.03117.50
5.6.200.0180.02217.81
5.6.190.0080.03017.81
5.6.180.0090.03317.69
5.6.170.0080.03517.85
5.6.160.0030.05117.86
5.6.150.0110.03217.69
5.6.140.0090.03517.74
5.6.130.0070.04217.74
5.6.120.0130.03717.74
5.6.110.0080.04017.87
5.6.100.0130.03917.85
5.6.90.0080.03817.82
5.6.80.0020.03817.23
5.6.70.0030.03517.35
5.6.60.0030.03717.30
5.6.50.0080.03217.39
5.6.40.0030.03717.36
5.6.30.0110.03017.38
5.6.20.0110.03717.53
5.6.10.0070.03317.29
5.6.00.0060.03817.37

preferences:
169.4 ms | 403 KiB | 5 Q