Re: PHP 4.0 Bug #5152: Object passed in a session generateserrors when member functions are called
| From: | Bug Hunter | Date: | Fri, 23 Jun 2000 17:30:41 +0000 |
| Subject: | Re: PHP 4.0 Bug #5152: Object passed in a session generateserrors when member functions are called | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-22062@lists.php.net to get a copy of this message | ||
On Fri, 23 Jun 2000, Andrei Zmievski wrote:
> On Thu, 22 Jun 2000, Bug Hunter wrote:
> > I _really_ like the idea of allowing an object to be serialized, warts
> > and all. I can see all kinds of uses for prepackaged objects that come
> > out of a deep freeze completely ready to go.
> >
> > I was told years ago that no one would ever want a personal computer.
> > The person that told me that still believes it. He is correct. People
> > like him don't want such a thing, or need it. Others, however, have
> > adopted it, even though it is the "wrong" thing to do.
>
> That is such a bad idea. Serializing opcodes just begs for trouble -
> Zend internal structure might change between the time you store and load
> an object and then what? There is a reason why OOP has concepts such as
> encapsulation.
>
It is a valid point not to serialize the opcodes. I expected the text
to be serialized, as it should not change notice-ably.
however, once you compiled it, you would have the opcode problem.
One thing to remember, though, is that you would have problems with zend
internal structures for compiled systems anyway. They are already
compiled down to opcodes, and the user would then have to re-run through
the zend compiler to make it work, regardless of whether or not the
objects were stored in a database or in a compiled file.
The implication is that on a very busy and full server, that the user
would NEVER upgrade because it is too much work to upgrade, and they would
have way too much downtime. If you cause things like this to occur, your
name will be used in vain in the future, especially if a site is an early
adoptor. You probably should put versioning information in with your
serialized data so you don't upset people in the future.
bug