3v4l.org

run code in 300+ PHP versions simultaneously
<?php $fileContents = <<<TEXT #################### Section One #################### Data A Data B #################### Section Two #################### Data C Data D Data E #################### Section Three #################### Data F TEXT; preg_match_all( '~(?: ^\#{3,}\R \h*(\S+(?:\h\S+)*)\h*\R \#{3,} | \G(?!\A) ) \R (?!\#{3,})(.+) ~mx', $fileContents, $out, PREG_SET_ORDER ); foreach ($out as $set) { $heading = $set[1] ?: $heading; $result[$heading][] = $set[2]; } var_export($result ?? 'No qualifying data');

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.0130.01016.86
8.5.00.0110.01120.36
8.4.150.0020.00114.05
8.4.140.0060.00417.82
8.4.130.0050.00617.76
8.4.120.0110.00920.50
8.4.110.0110.00922.24
8.4.100.0130.00717.98
8.4.90.0080.00318.92
8.4.80.0140.00618.04
8.4.70.0110.00918.28
8.4.60.0110.00919.08
8.4.50.0140.00820.30
8.4.40.0160.00320.68
8.4.30.0140.00318.79
8.4.20.0130.00724.13
8.4.10.0130.00321.41
8.3.280.0130.00718.76
8.3.270.0100.01316.91
8.3.260.0150.00516.79
8.3.250.0120.00819.04
8.3.240.0120.00816.76
8.3.230.0140.00516.59
8.3.220.0060.00919.06
8.3.210.0140.00518.68
8.3.200.0060.00317.01
8.3.190.0110.00617.11
8.3.180.0120.00716.66
8.3.170.0150.00316.93
8.3.160.0090.00617.44
8.3.150.0140.00416.72
8.3.140.0050.00318.55
8.3.130.0040.00416.94
8.3.120.0040.00419.11
8.3.110.0000.00816.77
8.3.100.0090.00618.50
8.3.90.0040.00426.77
8.3.80.0030.00719.36
8.3.70.0150.00618.18
8.3.60.0070.01418.55
8.3.50.0090.00923.61
8.3.40.0150.00419.35
8.3.30.0120.00619.10
8.3.20.0000.00824.18
8.3.10.0090.00624.66
8.3.00.0080.00026.16
8.2.290.0110.00820.56
8.2.280.0090.00818.86
8.2.270.0120.00616.94
8.2.260.0000.00817.23
8.2.250.0070.01116.94
8.2.240.0070.00318.46
8.2.230.0040.00420.94
8.2.220.0000.00924.06
8.2.210.0060.00326.77
8.2.200.0030.00618.88
8.2.190.0170.00316.59
8.2.180.0150.00025.92
8.2.170.0110.00418.95
8.2.160.0100.00322.96
8.2.150.0060.00325.66
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0050.00319.76
8.2.110.0090.00022.38
8.2.100.0040.00817.96
8.2.90.0100.00017.88
8.2.80.0040.00419.05
8.2.70.0060.00317.88
8.2.60.0050.00318.16
8.2.50.0030.00618.07
8.2.40.0040.00418.13
8.2.30.0080.00018.31
8.2.20.0000.00718.20
8.2.10.0000.00719.27
8.2.00.0000.00719.31
8.1.330.0090.00922.30
8.1.320.0120.00716.46
8.1.310.0110.00716.70
8.1.300.0040.01118.75
8.1.290.0040.00430.84
8.1.280.0110.00425.92
8.1.270.0070.00321.87
8.1.260.0060.00326.35
8.1.250.0060.00328.09
8.1.240.0090.00020.84
8.1.230.0080.00319.16
8.1.220.0000.00817.74
8.1.210.0060.00318.77
8.1.200.0090.00017.48
8.1.190.0000.00917.35
8.1.180.0040.00418.10
8.1.170.0000.00818.79
8.1.160.0080.00018.97
8.1.150.0040.00418.84
8.1.140.0040.00418.89
8.1.130.0030.00320.14
8.1.120.0000.00717.54
8.1.110.0050.00517.55
8.1.100.0080.00017.53
8.1.90.0050.00317.55
8.1.80.0080.00017.61
8.1.70.0000.00717.60
8.1.60.0030.00617.68
8.1.50.0040.00417.58
8.1.40.0040.00417.66
8.1.30.0000.00817.86
8.1.20.0050.00517.67
8.1.10.0040.00417.78
8.1.00.0030.00617.63
8.0.300.0000.00920.03
8.0.290.0080.00017.00
8.0.280.0000.00818.51
8.0.270.0000.00718.16
8.0.260.0030.00318.43
8.0.250.0070.00017.20
8.0.240.0000.00717.09
8.0.230.0000.00717.09
8.0.220.0000.00717.14
8.0.210.0000.00717.12
8.0.200.0040.00417.20
8.0.190.0040.00417.21
8.0.180.0000.00717.17
8.0.170.0030.00617.15
8.0.160.0000.00717.18
8.0.150.0030.00317.12
8.0.140.0040.00417.13
8.0.130.0050.00013.60
8.0.120.0050.00217.09
8.0.110.0040.00417.17
8.0.100.0040.00416.95
8.0.90.0000.00717.09
8.0.80.0100.00917.09
8.0.70.0070.00016.94
8.0.60.0070.00017.00
8.0.50.0000.00717.14
8.0.30.0170.00017.44
8.0.20.0120.01117.21
8.0.10.0040.00417.12
8.0.00.0140.01117.16
7.4.330.0030.00315.55
7.4.320.0000.00616.81
7.4.300.0060.00016.76
7.4.290.0000.00716.82
7.4.280.0030.00516.84
7.4.270.0000.00716.89
7.4.260.0000.00613.58
7.4.250.0000.00716.80
7.4.240.0000.00816.75
7.4.230.0030.00316.83
7.4.220.0020.00516.71
7.4.210.0090.00516.93
7.4.200.0030.00516.73
7.4.130.0110.00816.87
7.4.120.0070.01116.83
7.4.110.0110.00716.84
7.4.100.0120.00516.89
7.4.90.0110.00616.57
7.4.80.0130.00716.69
7.4.70.0040.01416.78
7.4.60.0070.01016.66
7.4.50.0120.00616.74
7.4.40.0090.00916.75
7.4.30.0040.01416.73
7.4.20.0130.00316.80
7.4.10.0110.00816.66
7.4.00.0040.01516.87
7.3.330.0000.00716.66
7.3.320.0030.00313.27
7.3.310.0040.00416.49
7.3.300.0040.00416.52
7.3.290.0070.00016.54
7.3.260.0030.01916.76
7.3.230.0120.00616.58
7.3.220.0070.01016.77
7.3.210.0100.00616.80
7.3.200.0140.00316.66
7.3.190.0120.00616.50
7.3.180.0090.00916.54
7.3.170.0090.00816.74
7.3.160.0100.01016.52
7.3.150.0090.00916.68
7.3.140.0150.00316.50
7.3.130.0070.01416.76
7.3.120.0140.00716.80
7.3.110.0080.00816.78
7.3.100.0100.01016.73
7.3.90.0140.00716.54
7.3.80.0040.01416.66
7.3.70.0130.00316.54
7.3.60.0090.00816.62
7.3.50.0000.01716.61
7.3.40.0130.00716.60
7.3.30.0000.02416.66
7.3.20.0150.00616.55
7.3.10.0060.01116.70
7.3.00.0140.00316.70
7.2.330.0080.01116.79
7.2.320.0110.00716.70
7.2.310.0030.01516.70
7.2.300.0070.01016.74
7.2.290.0180.00017.02
7.2.280.0090.00916.79
7.2.270.0070.01016.68
7.2.260.0040.01816.76
7.2.250.0160.00616.70
7.2.240.0030.01416.85
7.2.230.0100.00716.66
7.2.220.0090.01016.76
7.2.210.0060.01216.84
7.2.200.0090.00816.73
7.2.190.0120.00616.66
7.2.180.0100.01016.75
7.2.170.0090.00916.83
7.2.160.0100.01417.01
7.2.150.0130.00716.86
7.2.140.0060.01116.89
7.2.130.0140.00816.85
7.2.120.0150.00416.86
7.2.110.0120.00616.83
7.2.100.0110.00716.75
7.2.90.0140.00316.88
7.2.80.0040.01416.83
7.2.70.0120.00616.77
7.2.60.0160.00316.81
7.2.50.0090.00916.87
7.2.40.0140.01116.98
7.2.30.0090.00916.91
7.2.20.0140.00916.82
7.2.10.0060.01616.88
7.2.00.0100.01016.87

preferences:
31.91 ms | 403 KiB | 5 Q