3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = 'foo [abc - def - ghi - jkl] bar'; $regex = <<<REGEX / (?: #start a non-capturing group \[ #match a left square brace (?=[a-z -]+]) #lookahead for the completion of a valid placeholder expression | #or \G(?!^) #continue from end position of last match and not the start of the string \s-\s #match a whitespace, hyphen then a whitespace ) #close the non-capturing group \K #forget any matched characters up to this position [a-z]+ #match one or more lowercase ascii letters /x REGEX; if (preg_match_all($regex, $text, $match)) { var_export($match[0]); }

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.4.140.0110.01117.54
8.4.130.0110.00917.86
8.4.120.0130.00622.38
8.4.110.0130.00718.82
8.4.100.0120.00917.84
8.4.90.0140.00718.49
8.4.80.0140.00619.76
8.4.70.0100.01118.14
8.4.60.0150.00523.97
8.4.50.0110.00918.53
8.4.40.0030.00617.86
8.4.30.0090.00018.75
8.4.20.0040.00419.95
8.4.10.0030.00619.55
8.3.260.0120.00816.63
8.3.250.0090.00618.98
8.3.240.0120.00816.62
8.3.230.0130.00716.65
8.3.220.0100.00516.95
8.3.210.0040.00418.42
8.3.200.0080.00116.52
8.3.190.0060.00618.85
8.3.180.0100.00916.66
8.3.170.0100.01020.44
8.3.160.0160.00316.64
8.3.150.0090.00917.16
8.3.140.0120.00320.84
8.3.130.0080.00018.51
8.3.120.0090.00019.09
8.3.110.0040.00416.51
8.3.100.0040.00416.63
8.3.90.0160.00319.96
8.3.80.0440.00730.84
8.3.70.0390.01030.84
8.3.60.0430.00030.84
8.3.50.0100.01030.84
8.3.40.0310.01430.84
8.3.30.0320.00730.84
8.3.20.0350.00330.84
8.3.10.0320.00630.84
8.3.00.0260.01630.84
8.2.290.0130.00720.65
8.2.280.0110.00818.78
8.2.270.0170.00317.36
8.2.260.0040.01417.49
8.2.250.0060.00918.80
8.2.240.0000.00819.36
8.2.230.0040.00420.94
8.2.220.0050.00324.06
8.2.210.0160.00326.77
8.2.200.0300.01030.84
8.2.190.0330.00830.84
8.2.180.0300.00730.84
8.2.170.0430.01130.84
8.2.160.0310.01030.84
8.2.150.0420.00830.84
8.2.140.0270.00730.84
8.2.130.0350.00930.84
8.2.120.0320.00030.84
8.2.110.0300.00030.84
8.2.100.0220.00630.84
8.2.90.0240.00030.84
8.2.80.0190.00730.84
8.2.70.0220.00030.84
8.2.60.0340.00730.84
8.2.50.0370.00730.84
8.2.40.0350.00330.84
8.2.30.0250.01130.84
8.2.20.0240.01230.84
8.2.10.0260.01330.84
8.2.00.0320.00730.84
8.1.330.0110.00821.74
8.1.320.0070.00116.66
8.1.310.0040.00418.56
8.1.300.0030.00619.70
8.1.290.0310.00330.84
8.1.280.0250.01430.84
8.1.270.0390.00730.84
8.1.260.0380.00630.84
8.1.250.0420.00330.84
8.1.240.0300.00030.84
8.1.230.0220.00330.84
8.1.220.0240.00330.84
8.1.210.0380.00330.84
8.1.200.0360.00430.84
8.1.190.0190.01930.84
8.1.180.0310.00630.84
8.1.170.0280.01230.84
8.1.160.0400.00030.84
8.1.150.0400.00730.84
8.1.140.0200.01730.84
8.1.130.0230.00830.84
8.1.120.0330.00830.84
8.1.110.0360.00730.84
8.1.100.0330.00830.84
8.1.90.0210.00930.84
8.1.80.0250.00430.84
8.1.70.0100.01030.84
8.1.60.0050.01430.84
8.1.50.0160.00230.84
8.1.40.0180.00030.84
8.1.30.0190.00030.84
8.1.20.0180.00030.84
8.1.10.0160.00330.84
8.1.00.0320.00430.84

preferences:
33.27 ms | 403 KiB | 5 Q