- var_dump: documentation ( source)
- array_filter: documentation ( source)
<?php
class Test {
public function test() {
$self = $this;
$t = function($var) {
return ($this->hello($var));
};
$arr = array(true, false, true, false);
$arr = array_filter($arr, $t);
var_dump($arr);
}
public function hello($b) {
return $b;
}
}
$obj = new Test();
$obj->test();