NYCPHP Meetup

NYPHP.org

[nycphp-talk] PHP4 OOP Serialization

Frank Wong frank_wong2 at informationideas.com
Thu Feb 24 23:05:24 EST 2005


After further testing, objects inside an object are serialized without a
problem.  I made the mistake of reading someone's comment on php.net about
object serialization stating the problem I posted before and then looked for
evidence to prove his statement.  Stupid me.

________________________
Frank Wong

-----Original Message-----
From: talk-bounces at lists.nyphp.org
[mailto:talk-bounces at lists.nyphp.org]On Behalf Of Frank Wong
Sent: Thursday, February 24, 2005 10:15 PM
To: NYPHP Talk
Subject: [nycphp-talk] PHP4 OOP Serialization


Can someone shed some light on the following issue?

1: I have an object, A, that I create on a page.
2: Object A's constructor create an object, B and is stored in a variable in
object A.
3: I register object A as a session variable.
4: On my next page, I grab object A from the session and everything is fine.
5: I try to get object B from object A and it is not an object.

All objects definitions occur before session_start().

Is that the way object serialization supposed to work in PHP4?

If so, what is the best alternative to having an object within an object?

TIA

________________________
Frank Wong


_______________________________________________
New York PHP Talk Mailing List
AMP Technology
Supporting Apache, MySQL and PHP
http://lists.nyphp.org/mailman/listinfo/talk
http://www.nyphp.org






More information about the talk mailing list