- array_reduce: documentation ( source)
<?php
class One
{
public function first()
{
echo "1";
}
protected function second()
{
echo "2";
}
private function third()
{
echo "3";
}
public function main()
{
$mid = array(3, 4);
echo 4;
array_reduce($mid, function ($key, $val) {
$this->first();
$this->second();
$this->third();
});
}
}
$one = new One;
$one->main();