3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * @author: hakre <http://hakre.wordpress.com> * @link http://stackoverflow.com/a/17628617/367456 */ /** * dereference a value and optionally setting its type * * @param mixed $mixed * @param null $type (optional) * * @return mixed $mixed set as $type */ function rettype($mixed, $type = NULL) { $type === NULL || settype($mixed, $type); return $mixed; } $array = Array('status' => ['Figure A. ...' => ['regions' => ['321','324']]]); echo rettype($array, 'object')->status; // prints "Figure A. ..."

preferences:
45.56 ms | 402 KiB | 5 Q