3v4l.org

run code in 300+ PHP versions simultaneously
<?php class test{ public function pub() { $cool = $this->priv(); return [$cool + 5, 'someti', 'das', 'ok']; } private function priv() { $arr = array(1, '100', 1000); return $arr[2]; } } $newb = new test; var_dump($newb->pub()[2]);

preferences:
44.83 ms | 402 KiB | 5 Q