3v4l.org

run code in 300+ PHP versions simultaneously
<?php define('CALCULATION_REGEXP_STRUCTURED_REFERENCE', '([\p{L}_\\\\][\p{L}\p{N}\._]+)?(\[(?>[^\[\]]|(?R))+\])'); $formula = '=SUM(Sales_Data[[#This Row],[Q1]:[Q4]])'; $offset = 5; // This works // No start anchor, but using the preg_match() $offset argument to specify the start point for the search preg_match('/' . CALCULATION_REGEXP_STRUCTURED_REFERENCE . '/misu', $formula, $matches, 0, $offset); var_dump($matches); // This doesn't work // Creating a substring for the part of the formula that we want to search $partialFormula = substr($formula, $offset); var_dump($partialFormula); // and using the start anchor in our regexp preg_match('/^' . CALCULATION_REGEXP_STRUCTURED_REFERENCE . '/misu', $partialFormula, $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.70.0070.01116.75
8.3.60.0080.00818.43
8.3.50.0120.00320.20
8.3.40.0070.00720.29
8.3.30.0140.00619.02
8.3.20.0080.00024.18
8.3.10.0050.00324.66
8.3.00.0080.00026.16
8.2.180.0120.00425.92
8.2.170.0110.00419.07
8.2.160.0090.00622.96
8.2.150.0080.00025.66
8.2.140.0050.00224.66
8.2.130.0040.00426.16
8.2.120.0040.00421.16
8.2.110.0060.00320.52
8.2.100.0040.00818.09
8.2.90.0040.00418.00
8.2.80.0050.00319.11
8.2.70.0000.00917.63
8.2.60.0040.00417.93
8.2.50.0050.00518.07
8.2.40.0000.00818.16
8.2.30.0040.00418.32
8.2.20.0000.00720.49
8.2.10.0000.00718.38
8.2.00.0000.00719.44
8.1.280.0070.00725.92
8.1.270.0000.00823.99
8.1.260.0060.00326.35
8.1.250.0040.00428.09
8.1.240.0030.00719.18
8.1.230.0070.00417.83
8.1.220.0040.00417.91
8.1.210.0060.00318.77
8.1.200.0040.00417.72
8.1.190.0080.00017.60
8.1.180.0030.00518.10
8.1.170.0060.00318.71
8.1.160.0050.00319.03
8.1.150.0080.00018.86
8.1.140.0040.00417.72
8.1.130.0040.00419.04
8.1.120.0000.00717.55
8.1.110.0070.00017.68
8.1.100.0000.00817.64
8.1.90.0040.00417.54
8.1.80.0000.00817.67
8.1.70.0050.00617.56
8.1.60.0150.00217.63
8.1.50.0140.00317.62
8.1.40.0110.00517.60
8.1.30.0100.00417.77
8.1.20.0140.00217.73
8.1.10.0130.00417.68
8.1.00.0090.00817.65
8.0.300.0080.00018.77
8.0.290.0030.00617.00
8.0.280.0040.00418.52
8.0.270.0000.00818.22
8.0.260.0040.00418.57
8.0.250.0050.00317.11
8.0.240.0030.00317.19
8.0.230.0040.00417.27
8.0.220.0070.00017.15
8.0.210.0000.00817.30
8.0.200.0110.00217.10
8.0.190.0090.00617.17
8.0.180.0100.00517.13
8.0.170.0090.00517.05
8.0.160.0080.00717.13
8.0.150.0140.00117.04
8.0.140.0080.00516.99
8.0.130.0100.00517.02
8.0.120.0100.00117.12
8.0.110.0080.00417.15
8.0.100.0090.00417.13
8.0.90.0080.00517.15
8.0.80.0070.00817.25
8.0.70.0090.00617.03
8.0.60.0110.00317.00
8.0.50.0100.00317.11
8.0.30.0080.00617.15
8.0.20.0060.00817.18
8.0.10.0070.00517.22
7.4.330.0050.00015.55
7.4.320.0000.00616.72
7.4.300.0040.00716.83
7.4.290.0100.00216.79
7.4.280.0080.00316.85
7.4.270.0080.00516.86
7.4.260.0130.00416.81
7.4.250.0120.00216.83
7.4.240.0090.00616.79
7.4.230.0120.00316.83
7.4.220.0120.00416.88
7.4.210.0140.00116.71
7.4.200.0100.00416.83
7.4.190.0120.00316.78
7.4.180.0120.00316.83
7.4.160.0120.00316.80
7.4.150.0110.00416.84
7.4.140.0120.00216.77
7.4.130.0090.00516.77
7.4.120.0090.00616.64
7.4.110.0080.00616.64
7.4.100.0100.00516.78
7.4.90.0020.01116.69
7.4.80.0080.00516.74
7.4.70.0070.00616.74
7.4.60.0070.00716.71
7.4.50.0110.00216.65
7.4.40.0080.00316.64
7.4.30.0040.00616.73
7.4.20.0050.00416.57
7.4.10.0060.00516.65
7.4.00.0050.00616.60

preferences:
56.29 ms | 401 KiB | 5 Q