3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array = [ '.ws_config', 'Akms-wpp-all-vars.cfg', 'makes-lop-use-vars.cfg', '.ptp-sync/ASERD_EDITMSG', '.ptp-sync/index', '.ptp-sync/hooks/apply_value', ]; $hidden = new class (new ArrayIterator($array)) extends FilterIterator { public function accept(): bool { return !str_starts_with($this->current(), '.ptp-sync/'); } }; $result = iterator_to_array($hidden, true); print_r($result);

preferences:
97.27 ms | 1277 KiB | 5 Q