3v4l.org

run code in 300+ PHP versions simultaneously
<?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();

preferences:
53.26 ms | 402 KiB | 5 Q