3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = 'hello world good morning'; $result = []; $i = 0; while (preg_match_all("/(?=\b(\w+(?: \w+){{$i}})\b)/", $string, $m)) { array_unshift($result, $m[1]); ++$i; } var_export($result);

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.130.0130.00718.68
8.4.120.0140.00718.00
8.4.110.0070.00318.14
8.4.100.0120.00918.02
8.4.90.0070.01220.65
8.4.80.0120.00518.47
8.4.70.0130.00919.18
8.4.60.0120.00818.69
8.4.50.0140.00522.59
8.4.40.0090.00019.73
8.4.30.0060.00320.57
8.4.20.0090.00019.72
8.4.10.0040.00419.64
8.3.260.0130.00716.65
8.3.250.0120.00716.45
8.3.240.0130.00618.41
8.3.230.0100.01016.61
8.3.220.0090.00919.04
8.3.210.0140.00518.71
8.3.200.0060.00316.61
8.3.190.0110.00416.62
8.3.180.0080.01016.75
8.3.170.0160.00317.25
8.3.160.0060.01316.66
8.3.150.0130.00618.41
8.3.140.0130.00916.69
8.3.130.0000.00918.64
8.3.120.0000.00919.21
8.3.110.0040.00420.94
8.3.100.0140.00724.06
8.3.90.0000.00826.77
8.3.80.0080.00318.55
8.3.70.0160.00616.63
8.3.60.0040.01818.48
8.3.50.0100.01016.98
8.3.40.0140.00723.79
8.3.30.0080.01222.96
8.3.20.0030.01623.66
8.3.10.0090.00923.53
8.3.00.0080.01222.96
8.2.290.0110.00716.87
8.2.280.0100.01016.55
8.2.270.0160.00318.97
8.2.260.0140.00417.16
8.2.250.0090.00617.08
8.2.240.0080.00317.27
8.2.230.0030.00622.58
8.2.220.0040.00437.54
8.2.210.0040.01226.77
8.2.200.0060.00318.31
8.2.190.0090.00616.75
8.2.180.0070.00716.38
8.2.170.0090.00622.96
8.2.160.0190.00022.96
8.2.150.0120.00322.96
8.2.140.0100.01022.96
8.2.130.0070.01122.96
8.2.120.0060.01322.96
8.2.110.0060.01222.96
8.2.100.0040.01522.96
8.2.90.0150.00422.96
8.2.80.0070.01122.96
8.2.70.0100.01022.96
8.2.60.0150.00322.96
8.2.50.0120.00422.96
8.2.40.0140.00722.96
8.2.30.0090.01322.96
8.2.20.0120.00422.96
8.2.10.0030.01322.96
8.2.00.0060.01222.96
8.1.330.0140.00516.35
8.1.320.0080.01118.34
8.1.310.0000.00716.90
8.1.300.0120.00316.82
8.1.290.0090.00018.88
8.1.280.0150.00625.92
8.1.270.0140.00323.97
8.1.260.0070.01423.80
8.1.250.0110.00424.01
8.1.240.0120.00322.96
8.1.230.0040.01122.96
8.1.220.0040.01122.96
8.1.210.0120.00322.96
8.1.200.0090.00622.96
8.1.190.0040.01122.96
8.1.180.0140.00022.96
8.1.170.0070.00722.96
8.1.160.0140.00022.96
8.1.150.0140.00722.96
8.1.140.0190.00322.96
8.1.130.0090.01222.96
8.1.120.0070.01622.96
8.1.110.0100.01322.96
8.1.100.0120.00422.96
8.1.90.0070.01022.96
8.1.80.0120.00822.96
8.1.70.0120.00622.96
8.1.60.0080.00822.96
8.1.50.0220.00422.96
8.1.40.0160.01222.96
8.1.30.0210.01422.96
8.1.20.0250.00722.96
8.1.10.0160.00622.96
8.1.00.0150.00022.96

preferences:
30.36 ms | 403 KiB | 5 Q