I have the following function to get info from Sessions, so
public function get($_GET)
{
return $_SESSION['user']['info'][$_GET];
}
and when I try to get some data something weird happen
$this->get('id')
Output: i
Exception: Vlad
and with
$_SESSION[‘user’][‘info’][‘id’]; it works perfectly
Output: Vlad
$_GETis a reserved name for the super-global$_GET. You’ll probably get unexpected results if you try to use it in any other capacity. Change it to a regular$getor something like that.