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 03:00:02 +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-22035@lists.php.net to get a copy of this message | ||
On Thu, 22 Jun 2000, Rasmus Lerdorf wrote:
> > If you want to implement on-demand class loading, you are welcome to. That
> > actually might be interesting feature. But certainly it shouldn't shove it
> > into deserializer, though deserializer could use it. On-demand loading
> > could indeed be useful, though I imagine there could be some problems with
> > it (if there are more than one class in the file). But certainly this has
> > absolutely nothing common with shoving class code into object definition.
>
> And I repeat. My main point here was to maintain a connection between the
> class definition and the object data. That would make it possible to
> autoload them or provide user controlled loading without needing to keep
> track of which file might define which class.
>
> -Rasmus
I agree. I would carry it farther, and allow the functions to be
serialized totally, so that the text or opcodes made it in with the data.
However, that is details.
The reason I would like this goes to what I perceive the definition of
objects is. Objects is things. [bad english, I know].
If you can serialize an object and store it away and get it back without
having to jump through any complex coding hoops, then the object truly
becomes a thing.
I can imagine being able to store multiple objects in BLOBS in a
database and load in "one of this" and "two of that" and have a page come
up with _very_ little work on my part. I also get to share those objects
with every user on the system. I also get to _control_ the objects, as
system administrator, and can then give people controlled access to a lot
of stuff without divulging source code to the novice, or leaving files
around in public places that might be easy to modify for the cracker.
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.
bug