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";

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
160.39 ms | 2118 KiB | 15 Q