- var_dump: documentation ( source)
- array_filter: documentation ( source)
<?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());