3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = <<<'EOD' #1 (1) This is a test. a) This is a subtest one. b) And another one. (2) A really cool test. (3) Here is the problem, text for each numbered line is supposed to be on a single line like in (1) and (2), but the text often spans multiple lines of text. (4) How can I match the multi-line entries and unwrap them to single lines? #2 (1) This is a test. a) This is a subtest one. b) And another one. (2) A really cool test. (3) Here is the problem, text for each numbered line is supposed to be on a single line like in (1) and (2), but the text often spans multiple lines of text. (4) How can I match the multi-line entries and unwrap them to single lines? #3 (1) This is a test. a) This is a subtest one. b) And another one. (2) A really cool test. (3) Here is the problem, text for each numbered line is supposed to be on a single line like in (1) and (2), but the text often spans multiple lines of text. (4) How can I match the multi-line entries and unwrap them to single lines? a) dfk EOD; print_r(preg_split('~(\R+|^#\d+$)+(?=\(\d+\)|[a-z]\)|\z)~m', $str, -1, PREG_SPLIT_NO_EMPTY));

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.30.0080.01118.77
8.5.20.0150.00519.43
8.5.10.0060.00516.73
8.5.00.0120.01020.29
8.4.180.0150.00719.83
8.4.170.0110.01121.74
8.4.160.0130.00821.99
8.4.150.0070.00616.80
8.4.140.0160.00717.41
8.4.130.0120.00918.96
8.4.120.0050.00618.46
8.4.110.0080.01119.92
8.4.100.0110.01017.79
8.4.90.0080.01120.72
8.4.80.0160.00418.92
8.4.70.0100.00518.29
8.4.60.0090.00719.00
8.4.50.0130.00918.80
8.4.40.0000.00817.88
8.4.30.0200.00020.29
8.4.20.0030.01419.93
8.4.10.0040.00418.98
8.3.300.0160.00619.19
8.3.290.0130.00720.95
8.3.280.0140.00718.54
8.3.270.0120.01116.57
8.3.260.0030.00616.87
8.3.250.0100.00916.74
8.3.240.0100.00916.55
8.3.230.0080.01116.46
8.3.220.0100.00718.80
8.3.210.0050.00416.87
8.3.200.0050.00616.55
8.3.190.0110.00716.92
8.3.180.0100.00917.11
8.3.170.0140.00420.75
8.3.160.0140.00418.77
8.3.150.0090.00916.93
8.3.140.0070.00317.32
8.3.130.0080.00018.66
8.3.120.0040.00419.04
8.3.110.0110.00720.94
8.3.100.0040.00424.06
8.3.90.0040.00426.77
8.3.80.0080.00016.63
8.3.70.0110.00416.58
8.3.60.0140.00416.50
8.3.50.0070.00718.09
8.3.40.0030.01020.27
8.3.30.0090.00618.88
8.3.20.0070.00024.18
8.3.10.0040.00424.66
8.3.00.0070.00026.16
8.2.300.0140.00620.27
8.2.290.0100.00916.74
8.2.280.0070.00118.31
8.2.270.0130.00716.83
8.2.260.0150.00318.79
8.2.250.0070.00716.86
8.2.240.0150.00617.08
8.2.230.0080.00022.58
8.2.220.0030.00637.54
8.2.210.0030.00626.77
8.2.200.0040.00416.88
8.2.190.0040.01116.58
8.2.180.0090.00625.92
8.2.170.0080.00819.13
8.2.160.0030.01022.96
8.2.150.0040.00425.66
8.2.140.0030.00524.66
8.2.130.0040.00426.16
8.2.120.0070.00026.16
8.2.110.0030.00622.08
8.2.100.0030.01019.76
8.2.90.0030.00617.88
8.2.80.0000.00918.86
8.2.70.0030.00717.61
8.2.60.0040.00417.93
8.2.50.0030.00517.91
8.2.40.0000.00817.75
8.2.30.0050.00317.79
8.2.20.0040.00419.47
8.2.10.0040.00418.81
8.2.00.0030.00519.26
8.1.340.0130.00820.21
8.1.330.0080.01116.36
8.1.320.0130.00620.13
8.1.310.0040.01216.78
8.1.300.0040.00716.40
8.1.290.0060.00318.88
8.1.280.0090.00625.92
8.1.270.0040.00423.99
8.1.260.0050.00326.35
8.1.250.0070.00028.09
8.1.240.0060.00323.83
8.1.230.0040.00719.17
8.1.220.0040.00418.52
8.1.210.0030.00518.77
8.1.200.0030.00917.35
8.1.190.0040.00417.35
8.1.180.0070.00218.10
8.1.170.0040.00417.62
8.1.160.0030.00520.50
8.1.150.0040.00418.74
8.1.140.0030.00617.54
8.1.130.0070.00018.86
8.1.120.0000.00717.39
8.1.110.0040.00417.48
8.1.100.0040.00417.38
8.1.90.0040.00417.55
8.1.80.0090.00017.47
8.1.70.0030.00317.50
8.1.60.0080.00017.69
8.1.50.0040.00417.61
8.1.40.0040.00417.55
8.1.30.0030.00617.58
8.1.20.0030.00517.75
8.1.10.0050.00317.63
8.1.00.0050.00317.41
8.0.300.0060.00318.77
8.0.290.0040.00416.75
8.0.280.0040.00418.39
8.0.270.0000.00716.95
8.0.260.0050.00318.40
8.0.250.0030.00317.10
8.0.240.0000.00617.15
8.0.230.0040.00417.00
8.0.220.0000.00816.96
8.0.210.0040.00416.93
8.0.200.0000.00717.02
8.0.190.0050.00316.98
8.0.180.0070.00017.09
8.0.170.0060.00316.91
8.0.160.0000.00717.02
8.0.150.0050.00216.99
8.0.140.0000.01117.04
8.0.130.0060.00013.54
8.0.120.0040.00416.92
8.0.110.0110.00017.11
8.0.100.0080.00316.95
8.0.90.0000.01017.15
8.0.80.0050.00516.87
8.0.70.0000.01016.98
8.0.60.0050.00517.00
8.0.50.0030.00716.87
8.0.30.0000.01016.97
8.0.20.0030.00716.93
8.0.10.0050.00517.08
8.0.00.0100.00017.24
7.4.330.0020.00215.55
7.4.320.0030.00316.73
7.4.300.0060.00016.61
7.4.290.0000.00716.66
7.4.280.0040.00416.63
7.4.270.0070.00016.76
7.4.260.0000.00513.32
7.4.250.0020.00516.77
7.4.240.0050.00516.68
7.4.230.0030.00716.77
7.4.220.0090.00016.80
7.4.210.0060.00316.69
7.4.200.0050.00516.78
7.4.190.0050.00516.89
7.4.180.0050.00516.85
7.4.160.0050.00516.76
7.4.150.0030.00816.84
7.4.140.0090.00316.63
7.4.130.0120.00016.48
7.4.120.0070.00316.59
7.4.110.0110.00016.68
7.4.100.0120.00016.81
7.4.90.0040.00816.60
7.4.80.0030.00916.52
7.4.70.0070.00416.63
7.4.60.0090.00316.66
7.4.50.0100.00216.56
7.4.40.0120.00016.58
7.4.30.0030.00816.53
7.4.20.0050.00516.40
7.4.10.0000.00916.56
7.4.00.0020.00716.61
7.3.330.0000.00716.31
7.3.320.0000.00713.26
7.3.310.0030.00516.43
7.3.300.0000.01016.43
7.3.290.0030.00716.51
7.3.280.0050.00516.41
7.3.270.0000.01016.17
7.3.260.0070.00316.33
7.3.250.0070.00416.30
7.3.240.0080.00316.20
7.3.230.0030.00816.39
7.3.220.0030.00716.27
7.3.210.0100.00016.38
7.3.200.0030.00716.13
7.3.190.0080.00316.30
7.3.180.0070.00316.34
7.3.170.0050.00516.37
7.3.160.0070.00316.27
7.3.150.0060.00516.27
7.3.140.0050.00516.20
7.3.130.0080.00316.44
7.3.120.0000.01016.18
7.3.110.0050.00516.34
7.3.100.0070.00416.14
7.3.90.0080.00316.72
7.3.80.0070.00416.34
7.3.70.0050.00516.43
7.3.60.0030.00716.47
7.3.50.0090.00016.42
7.3.40.0080.00316.28
7.3.30.0070.00316.30
7.3.20.0060.00416.52
7.3.10.0000.01116.40
7.3.00.0050.00516.20

preferences:
46.52 ms | 1643 KiB | 5 Q