php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #10063 Session variable aren't visible from class
Submitted: 2001-03-29 12:49 UTC Modified: 2001-03-29 13:01 UTC
From: thierry dot bertin at videotron dot ca Assigned:
Status: Closed Package: Class/Object related
PHP Version: 4.0.4pl1 OS: linux mandrake 7.2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
49 + 40 = ?
Subscribe to this entry?

 
 [2001-03-29 12:49 UTC] thierry dot bertin at videotron dot ca
I hope you excuse me for my poor english...

So, i try to use a session and sessions variables in php.
It's work fine, but when i try to use a variable into a object class, the values of my variables aren't visible thru the clas and function of this class.

I declare the variables as global in the class constructor, then i can acces to the value but not in a function of this class.

regards

Thierry

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-03-29 13:01 UTC] hholzgra@php.net
you have to use global in every class method
class methods behave exactly like normal functions
in this context, a global declaration within
the constructor is local to the constructor method
itself and will *not* be remembered in the other
methods
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 30 11:01:29 2024 UTC