3v4l.org

run code in 300+ PHP versions simultaneously
<?php $fruits = ['apple', 'orange', 'melon', 'banana', 'pineapple']; foreach ($fruits as $key=>$fruit) { if (in_array($fruit, ['apple', 'orange', 'melon', 'banana'])) { unset($fruits[$key]); } } print_r($fruits);

preferences:
61.94 ms | 404 KiB | 5 Q