473,386 Members | 1,803 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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.
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?
Jul 17 '05 #1
2 2009
co**********@yahoo.com (college) emerged reluctantly from the
curtain and staggered drunkenly up to the mic. In a cracked and
slurred voice he muttered:
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?


Not unless the objects were serialized first.

See http://www.php.net/serialize

--
Phil Roberts | Deedle Doot Doo Dee Dee | http://www.flatnet.net/
This global evolutionist conspiracy of evil athiests can kiss
my ass! Wheres my goddamn cheque??
Jul 17 '05 #2
"college" <co**********@yahoo.com> wrote in message
news:8d**************************@posting.google.c om...
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/
Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

20
by: Corno | last post by:
Hi all, There's probably a good reason why a const object can call non const functions of the objects where it's member pointers point to. I just don't see it. For me, that makes the the const...
2
by: Patrick | last post by:
Hi I have a problem in my C++ Funktion. I needed an 2 dimensional Array. For this i took a template script in order to create the array in the funktion. The Size of the Array I have to calculate...
6
by: surrealtrauma | last post by:
i have a trouble about that: i want to ask user to enter the employee data (employee no., name, worked hour, etc.), but i dont know how to sort the data related to a particular employee as a...
21
by: yeti349 | last post by:
Hi, I'm using the following code to retrieve data from an xml file and populate a javascript array. The data is then displayed in html table form. I would like to then be able to sort by each...
272
by: Peter Olcott | last post by:
http://groups.google.com/group/comp.lang.c++/msg/a9092f0f6c9bf13a I think that the operator() member function does not work correctly, does anyone else know how to make a template for making two...
10
by: Raj | last post by:
I need a VB function to return array of collections like Private Type Employee empname as string address as string salary as integer deptno as integer End Type dim employees() as Employee
2
by: StevenChiasson | last post by:
For the record, not a student, just someone attempting to learn C++. Anyway, the problem I'm having right now is the member function detAddress, of object controller. This is more or less, your...
5
by: Immortal Nephi | last post by:
I would like to design an object using class. How can this class contain 10 member functions. Put 10 member functions into member function pointer array. One member function uses switch to call...
152
by: vippstar | last post by:
The subject might be misleading. Regardless, is this code valid: #include <stdio.h> void f(double *p, size_t size) { while(size--) printf("%f\n", *p++); } int main(void) { double array = { {...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.