3v4l.org

run code in 300+ PHP versions simultaneously
<?php $masks = ['1224*', '543*', '321*', '12245*', '5*', '122488*']; sort($masks); $needle = rtrim(array_shift($masks), '*'); $keep[] = $needle; foreach ($masks as $mask) { if (strpos($mask, $needle) !== 0) { $needle = rtrim($mask, '*'); $keep[] = $needle; } } // now $keep only contains: ['1224', '321', '5'] $numbers = ['122456789', '123456788', '321876543234567', '55555555555555555', '987654321']; var_export( preg_grep('~^(?:' . implode('|', $keep) . ')~', $numbers) );

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.120.0120.00520.35
8.4.110.0080.00922.11
8.4.100.0140.00617.62
8.4.90.0110.01019.00
8.4.80.0050.00419.77
8.4.70.0050.00318.10
8.4.60.0110.00918.76
8.4.50.0150.00819.55
8.4.40.0060.01318.02
8.4.30.0100.01120.36
8.4.20.0030.00718.20
8.4.10.0130.00726.07
8.3.250.0110.00819.11
8.3.240.0060.00616.75
8.3.230.0130.00616.65
8.3.220.0120.00717.15
8.3.210.0120.00716.75
8.3.200.0060.00316.79
8.3.190.0130.00718.91
8.3.180.0100.00916.82
8.3.170.0150.00320.54
8.3.160.0120.00618.25
8.3.150.0060.01320.88
8.3.140.0040.00417.10
8.3.130.0080.00018.54
8.3.120.0080.00318.90
8.3.110.0060.00320.94
8.3.100.0160.00618.81
8.3.90.0080.00026.77
8.3.80.0060.00319.36
8.3.70.0070.01118.29
8.3.60.0120.00318.38
8.3.50.0130.00524.57
8.3.40.0060.00918.95
8.3.30.0080.00818.84
8.3.20.0000.00724.18
8.3.10.0000.00824.66
8.3.00.0030.01426.16
8.2.290.0070.01220.63
8.2.280.0060.00318.51
8.2.270.0160.00017.06
8.2.260.0110.00720.26
8.2.250.0060.00316.89
8.2.240.0060.00317.16
8.2.230.0060.00322.58
8.2.220.0100.00624.06
8.2.210.0050.00326.77
8.2.200.0030.00618.88
8.2.190.0070.00718.54
8.2.180.0110.00725.92
8.2.170.0150.00019.21
8.2.160.0100.00722.96
8.2.150.0000.00825.66
8.2.140.0070.00024.66
8.2.130.0040.00426.16
8.2.120.0080.00026.35
8.2.110.0040.00422.36
8.2.100.0090.00317.77
8.2.90.0030.00617.84
8.2.80.0060.00318.94
8.2.70.0030.00517.91
8.2.60.0040.00418.34
8.2.50.0000.00818.10
8.2.40.0040.00421.15
8.2.30.0000.00719.50
8.2.20.0040.00418.15
8.2.10.0040.00419.34
8.2.00.0040.00419.43
8.1.330.0100.00822.28
8.1.320.0040.00516.49
8.1.310.0070.00316.93
8.1.300.0120.00318.50
8.1.290.0030.00630.84
8.1.280.0060.01225.92
8.1.270.0100.01022.02
8.1.260.0000.00828.09
8.1.250.0050.00328.09
8.1.240.0030.00721.18
8.1.230.0090.00317.77
8.1.220.0030.00517.74
8.1.210.0050.00318.77
8.1.200.0060.00317.35
8.1.190.0030.00617.48
8.1.180.0060.00318.10
8.1.170.0050.00318.78
8.1.160.0000.00718.99
8.1.150.0040.00418.95
8.1.140.0040.00419.00
8.1.130.0030.00320.21
8.1.120.0040.00417.54
8.1.110.0070.00017.54
8.1.100.0070.00017.61
8.1.90.0040.00417.50
8.1.80.0030.00517.69
8.1.70.0000.00717.68
8.1.60.0030.00617.79
8.1.50.0050.00317.58
8.1.40.0050.00317.68
8.1.30.0050.00517.75
8.1.20.0080.00017.74
8.1.10.0000.00917.70
8.1.00.0040.00417.61
8.0.300.0020.00518.77
8.0.290.0000.00917.00
8.0.280.0050.00318.42
8.0.270.0070.00016.99
8.0.260.0030.00318.48
8.0.250.0080.00017.02
8.0.240.0030.00317.14
8.0.230.0030.00817.13
8.0.220.0050.00317.09
8.0.210.0040.00417.04
8.0.200.0030.00317.10
8.0.190.0000.00817.11
8.0.180.0040.00417.04
8.0.170.0040.00417.04
8.0.160.0040.00417.13
8.0.150.0040.00417.02
8.0.140.0000.00717.01
8.0.130.0000.00513.46
8.0.120.0080.00016.92
8.0.110.0040.00416.88
8.0.100.0000.00717.10
8.0.90.0040.00416.93
8.0.80.0050.01416.99
8.0.70.0000.00717.11
8.0.60.0000.00817.09
8.0.50.0040.00417.08
8.0.30.0060.01017.29
8.0.20.0090.01117.40
8.0.10.0190.00317.40
8.0.00.0190.00017.40
7.4.330.0000.00516.71
7.4.320.0000.00616.70
7.4.300.0060.00016.73
7.4.290.0000.00816.67
7.4.280.0000.00916.84
7.4.270.0030.00316.84
7.4.260.0030.00313.53
7.4.250.0020.00516.79
7.4.240.0000.00716.76
7.4.230.0040.00416.82
7.4.220.0040.00416.81
7.4.210.0060.00916.83
7.4.200.0000.00716.55
7.4.150.0070.01117.40
7.4.140.0080.01017.40
7.4.130.0130.00917.40
7.4.120.0110.00717.40
7.4.110.0230.01217.40
7.4.100.0090.00917.40
7.4.90.0150.01017.40
7.4.80.0130.01017.40
7.4.70.0150.01117.40
7.4.60.0080.01317.40
7.4.50.0130.00517.40
7.4.40.0180.01317.40
7.4.30.0240.00917.40
7.4.20.0150.01517.40
7.4.10.0220.00617.40
7.4.00.0070.01117.40
7.3.330.0030.00516.36
7.3.320.0000.00513.24
7.3.310.0030.00316.30
7.3.300.0070.00016.46
7.3.290.0100.00916.49
7.3.270.0070.01517.40
7.3.260.0170.00417.40
7.3.250.0140.00717.40
7.3.240.0050.01417.40
7.3.230.0290.00317.40
7.3.220.0300.00717.40
7.3.210.0150.01017.40
7.3.200.0150.00917.40
7.3.190.0110.01117.40
7.3.180.0160.00617.40
7.3.170.0090.01317.40
7.3.160.0290.00417.40
7.3.150.0270.00917.40
7.3.140.0180.01817.40
7.3.130.0300.00817.40
7.3.120.0110.00717.40
7.3.110.0260.00417.40
7.3.100.0180.01217.40
7.3.90.0000.01917.40
7.3.80.0310.03117.40
7.3.70.0560.00417.40
7.3.60.0360.01517.40
7.3.50.0300.00417.40
7.3.40.0420.00917.40
7.3.30.0110.02417.40
7.3.20.0230.01217.40
7.3.10.0230.01117.40
7.3.00.0460.00017.40

preferences:
32.55 ms | 403 KiB | 5 Q