Re: [PHP] accessing variables within objects
- From: micah@xxxxxxxxxxx (Micah Gersten)
- Date: Wed, 30 Jul 2008 15:00:00 -0500
You might want to check the scope of the properties. If you want to
access them outside of the class, make sure they are declared public.
Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com
Marten Lehmann wrote:
Hello,.
I'm using some php-classes which worked fine with php-5.0.4. Now I
tried to upgrade to php-5.2.6, but the classes give a lot of errors.
If I set
error_reporting(E_ALL);
I see messages like
Notice: Undefined property: FastTemplate::$main in
/whereever/inc.template.php on line 293
Notice: Undefined property: current_session::$cust_id in
/whereever/inc.init.php on line 117
In inc.template.php there are a lot of calls like $this->$key. In
inc.init.php there are calls like $session->cust_id.
What has changed in php-5.2.x so that these calls don't work any more?
What is the new, required form to use objects in a similar manner
(unfortunately I have no ressources to code these classes from
scratch)? Thanks.
Kind regards
Marten
- References:
- accessing variables within objects
- From: Marten Lehmann
- accessing variables within objects
- Prev by Date: Re: [PHP] accessing variables within objects
- Next by Date: Re: [PHP] Php CLI Parser not working
- Previous by thread: Re: [PHP] accessing variables within objects
- Next by thread: Re: accessing variables within objects
- Index(es):
Relevant Pages
|