3v4l.org

run code in 300+ PHP versions simultaneously
<?php function check($r) { $perms = array('get'); $action = 'get_status'; $user_sub_resource = in_array($action, array('get_securityquestions', 'get_status', 'get_groupstats')); $user_id = null; if ($user_sub_resource && isset($r['user_id'])) { $user_id = $r['user_id']; } else if (isset($r['id'])) { $user_id = $r['id']; } if ($user_sub_resource) { return "user sub resource"; } else { return "no user sub"; } } echo PHP_VERSION, "\n"; echo check(['user_id' => 1]), "\n";

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
162.83 ms | 2033 KiB | 11 Q