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.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.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.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:
10.96 ms | 406 KiB | 5 Q