3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function other($asdf) { echo "Other: $asdf"; return true; } public function fn() { static $a = array('a', 'b', 'c', 'd'); $self = $this; return array_filter($a, function($n) use ($self) { $self->other($n); return true; }); } } $a = new A(); var_dump($a->fn());

preferences:
38.11 ms | 402 KiB | 5 Q