3v4l.org

run code in 300+ PHP versions simultaneously
<?php function filter_ingredients($elements) { return implode(', ', array_filter(preg_split('/,\s*/', $elements), function ($v) { return !preg_match('/^no\b/', $v); })); } echo filter_ingredients("cheese, no tomato, no onion, mayo, no lettuce") . "\n"; echo filter_ingredients("no cheese, tomato, no onion, no&nbsp;mayo, lettuce") . "\n"; echo filter_ingredients("no cheese, no&nbsp;tomato, onion, no mayo, no lettuce") . "\n";

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.0110.01124.07
8.4.110.0110.00918.74
8.4.100.0120.00619.09
8.4.90.0110.00720.71
8.4.80.0130.00518.72
8.4.70.0120.00818.37
8.4.60.0100.00918.97
8.4.50.0100.01117.68
8.4.40.0080.00017.74
8.4.30.0060.01018.44
8.4.20.0100.01020.68
8.4.10.0040.00417.63
8.3.250.0130.00618.79
8.3.240.0060.00417.15
8.3.230.0090.00816.89
8.3.220.0130.00518.87
8.3.210.0120.00816.70
8.3.200.0030.00616.68
8.3.190.0050.00316.95
8.3.180.0120.00718.25
8.3.170.0070.00718.95
8.3.160.0090.00018.36
8.3.150.0070.01119.08
8.3.140.0000.00817.31
8.3.130.0050.00318.61
8.3.120.0040.00420.75
8.3.110.0080.01120.94
8.3.100.0080.00024.06
8.3.90.0000.00926.77
8.3.80.0030.00618.56
8.3.70.0170.00416.73
8.3.60.0140.00718.43
8.3.50.0080.00923.62
8.3.40.0120.00318.77
8.3.30.0130.01018.87
8.3.20.0050.00320.80
8.3.10.0060.00320.34
8.3.00.0060.00622.39
8.2.290.0080.00720.36
8.2.280.0100.00918.42
8.2.270.0110.00717.21
8.2.260.0060.00318.42
8.2.250.0040.00416.71
8.2.240.0000.00817.13
8.2.230.0090.00022.58
8.2.220.0040.00437.54
8.2.210.0060.01226.77
8.2.200.0030.00716.50
8.2.190.0160.00316.75
8.2.180.0080.01218.66
8.2.170.0060.01222.96
8.2.160.0110.00322.28
8.2.150.0030.00524.18
8.2.140.0040.00424.66
8.2.130.0000.00826.16
8.2.120.0050.00226.16
8.2.110.0060.00320.54
8.2.100.0040.00817.72
8.2.90.0030.00517.75
8.2.80.0060.00318.85
8.2.70.0040.00417.63
8.2.60.0040.00417.80
8.2.50.0060.00318.05
8.2.40.0040.00418.16
8.2.30.0070.00019.40
8.2.20.0080.00018.10
8.2.10.0040.00419.35
8.2.00.0080.00019.22
8.1.330.0110.00721.66
8.1.320.0080.01116.31
8.1.310.0040.00416.71
8.1.300.0060.00918.37
8.1.290.0040.00430.84
8.1.280.0150.00425.92
8.1.270.0030.00522.20
8.1.260.0040.00426.35
8.1.250.0030.00528.09
8.1.240.0060.00321.25
8.1.230.0040.00817.83
8.1.220.0040.00417.74
8.1.210.0030.00618.77
8.1.200.0050.00517.36
8.1.190.0040.00417.35
8.1.180.0070.00318.10
8.1.170.0040.00417.62
8.1.160.0000.00718.86
8.1.150.0030.00618.78
8.1.140.0000.00718.77
8.1.130.0040.00421.98
8.1.120.0030.00517.46
8.1.110.0050.00217.57
8.1.100.0050.00317.57
8.1.90.0080.00417.54
8.1.80.0020.00517.46
8.1.70.0070.00017.57
8.1.60.0040.00417.57
8.1.50.0040.00417.53
8.1.40.0030.00517.59
8.1.30.0090.00017.59
8.1.20.0080.00017.72
8.1.10.0000.00717.55
8.1.00.0030.00617.62
8.0.300.0040.00418.77
8.0.290.0040.00416.75
8.0.280.0000.00718.41
8.0.270.0000.00718.05
8.0.260.0000.00620.09
8.0.250.0000.00717.05
8.0.240.0000.00616.91
8.0.230.0040.00417.06
8.0.220.0040.00416.85
8.0.210.0000.00716.91
8.0.200.0000.00817.07
8.0.190.0050.00417.06
8.0.180.0040.00417.04
8.0.170.0100.00016.95
8.0.160.0040.00416.96
8.0.150.0030.00516.77
8.0.140.0050.00916.95
8.0.130.0000.00513.45
8.0.120.0070.00016.95
8.0.110.0000.00716.99
8.0.100.0040.00416.91
8.0.90.0030.00617.09
8.0.80.0100.00516.94
8.0.70.0050.00216.85
8.0.60.0040.00417.03
8.0.50.0050.00217.06
8.0.30.0150.00917.36
8.0.20.0100.01117.44
8.0.10.0000.00716.95
8.0.00.0070.01617.16
7.4.330.0000.00515.55
7.4.320.0040.00416.80
7.4.300.0040.00416.69
7.4.290.0000.00716.64
7.4.280.0000.00816.71
7.4.270.0040.00416.74
7.4.260.0050.00013.44
7.4.250.0070.00016.63
7.4.240.0020.00516.72
7.4.230.0030.00616.56
7.4.220.0030.00416.77
7.4.210.0060.01216.73
7.4.200.0070.00016.47
7.4.130.0080.01416.72
7.4.120.0110.01116.73
7.4.110.0030.01316.66
7.4.100.0110.00816.66
7.4.90.0100.00716.77
7.4.80.0150.00519.39
7.4.70.0060.00916.81
7.4.60.0080.01216.64
7.4.50.0100.00716.63
7.4.40.0100.00716.52
7.4.30.0090.00716.49
7.4.20.0050.01016.59
7.4.10.0080.00816.75
7.4.00.0070.01616.69
7.3.330.0000.00716.36
7.3.320.0030.00313.34
7.3.310.0040.00416.43
7.3.300.0070.00016.41
7.3.290.0100.00616.38
7.3.260.0100.00716.46
7.3.240.0060.01116.49
7.3.230.0040.01316.51
7.3.210.0120.00416.41
7.3.200.0110.00616.64
7.3.190.0060.01516.46
7.3.180.0080.00816.79
7.3.170.0120.00616.76
7.3.160.0130.00316.71
7.3.150.0070.01016.59
7.3.140.0090.00916.62
7.3.130.0100.00616.59
7.3.120.0140.00716.47
7.3.110.0070.01416.64
7.3.100.0100.00616.25
7.3.90.0090.00816.45
7.3.80.0090.00616.75
7.3.70.0030.01316.32
7.3.60.0130.00316.53
7.3.50.0080.01416.47
7.3.40.0030.01716.43
7.3.30.0070.01716.55
7.3.20.0150.00616.52
7.3.10.0090.01516.63
7.3.00.0190.00316.42
7.2.330.0070.01016.55
7.2.320.0090.00916.80
7.2.310.0030.01316.54
7.2.300.0070.01016.79
7.2.290.0100.00716.84
7.2.280.0030.01416.71
7.2.270.0160.00316.57
7.2.260.0100.01316.82
7.2.250.0060.01616.64
7.2.240.0090.00916.66
7.2.230.0040.01516.65
7.2.220.0090.00616.77
7.2.210.0000.01616.74
7.2.200.0090.00916.68
7.2.190.0090.00916.65
7.2.180.0110.01116.75
7.2.170.0110.01116.73
7.2.160.0030.01916.70
7.2.150.0070.01516.88
7.2.140.0240.00316.76
7.2.130.0040.01816.81
7.2.120.0130.00416.74
7.2.110.0060.01216.69
7.2.100.0060.01116.70
7.2.90.0070.01116.78
7.2.80.0060.01216.65
7.2.70.0140.00616.72
7.2.60.0090.00816.55
7.2.50.0080.01216.59
7.2.40.0110.00716.87
7.2.30.0110.00716.84
7.2.20.0040.01616.80
7.2.10.0120.01216.74
7.2.00.0110.00716.63

preferences:
27.98 ms | 403 KiB | 5 Q