Re: Array of Objects in session, is it possible to access member functions?

From: rush (pipa_at_rush.avalon.hr)
Date: 07/29/04


Date: Thu, 29 Jul 2004 17:43:47 +0200


"college" <collegeguys4@yahoo.com> wrote in message
news:8da449c8.0407281305.50bf212d@posting.google.com...
> I am trying to pass an array of user objects in session and take the
> array out of session and call the member functions of each object.
> However I am getting a Fatal error: Call to a member function on a
> non-object. I have session.autostart turned off, and I have the
> class definition for those objects included before the call to
> session_start(). I am on PHP 4.2.3. Is this possible to do? While
> debugging, it appears that the objects in the array are only seen as a
> type of standard "object", and that I can only access the member
> variables of the object. I tried casting to the user defined class,
> but this does not see to work. Is there a way to pull these objects
> out of an array that was in the session, and call the member functions
> of these objects?

yes but, the class of the object in the question should also be defined in
the code that is executing the function call.

--
http://www.templatetamer.com/


Relevant Pages

  • Array of Objects in session, is it possible to access member functions?
    ... I am trying to pass an array of user objects in session and take the ... array out of session and call the member functions of each object. ...
    (comp.lang.php)
  • Re: [PHP] SESSION array problems
    ... $_SESSION = array( ... echo ''; ... don't you create user objects and then just stick the objectin the ... $_SESSION array? ...
    (php.general)
  • RE: Session variables and reference
    ... Session variable that is an array of a class I created: ... public cut//copy constructor ... Kmax = myCut.Kmax; ... I realized that when I set my temporary array to equal the session array, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: 2 dimension arrays
    ... > How do I declare an array as a session variable? ... as you have a *reference* to this array, there is really only one array ... >> Andrew wrote: ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: help with array within another array
    ... you could make a hash with reference to hash values: ... it seems like you might want to consider using the node identifier as the first key in %SESSION, and make the value a reference to hash keyed by the owner and severity: ... I am trying to declare two associative array ...
    (perl.beginners)