Cannot cast to a user object in PHP
Posted on 2007-11-17
IÃƒÂ¢Ã‚Â€Ã‚Â™ve got a PHP class called User which I am using across sessions by implementing the __sleep and __wakeup methods. The class itself is working fine, but IÃƒÂ¢Ã‚Â€Ã‚Â™ve lost introspection within the visual studio IDE as I have to get it from the session object and not via the new object keyword.
So when I do $user = new User(); code completion works fine as the IDE knows itÃƒÂ¢Ã‚Â€Ã‚Â™s a User object.
However, when I do $user = $_SESSION['user']; the IDE doesnÃƒÂ¢Ã‚Â€Ã‚Â™t know what type it is and I lose the code completion.
Does anyone know how I could get around this?