3v4l.org

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

preferences:
41.68 ms | 402 KiB | 5 Q