Re: [PHP] accessing variables within objects



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

.



Relevant Pages

  • Re: upgrade 7.3-1 --> 7.3-2
    ... >>This error message is not appropriate for the circumstances. ... >>Disregard the recommendation to terminate the upgrade. ... I think "out of scope" is PCSI jargon for "this is an unexpected ... been prevented by better or more documentation? ...
    (comp.os.vms)
  • Re: ruby1.9 block scope
    ... Do you mean upgrade the scope of the variable dynamically? ... in stone at the lexical level. ... But if you could upgrade their scoping ...
    (comp.lang.ruby)
  • Re: 9.3 - a bit of a disappointment
    ... > multimedia, most things just work but leave me with scope for tinkering. ... TV-cards at all in version 9.2. ... upgrade and just add the second board. ...
    (alt.os.linux.suse)
  • Error building OpenEXR
    ... Attempting to upgrade the ports on my machine, ... I then tried deleting OpenEXR and reinstalling it, but that did not work out. ... b44ExpLogTable.cpp:85: error: `half' was not declared in this scope ...
    (freebsd-questions)
  • Re: ruby1.9 block scope
    ... |Ah, ok, then I guess I *did* dream the whole thing. ... upgraded to the level of the reference. ... Do you mean upgrade the scope of the variable dynamically? ...
    (comp.lang.ruby)