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

From: college (collegeguys4_at_yahoo.com)
Date: 07/28/04


Date: 28 Jul 2004 14:05:39 -0700

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?



Relevant Pages

  • Re: 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: 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)
  • Re: [PHP] SESSION problem
    ... But, if you came from a background that predated associate arrays, then using numeric indexes would seem more natural. ... looked into the session extension in that level of detail, but I doubt such a limitation would exist if there was not a very good reason for it. ... Given that I can't see into the future, even if I currently only have one set of data to store in the session I wouldn't just chuck the bits of paper from the file into the filing cabinet. ... The root level of the session array should contain descriptive keys, and I've never been in a situation where 5318008 is descriptive and gives context to the data unless you turn it upside down! ...
    (php.general)