Re: [PHP4BETA] Re: [PHP3] OO
| From: | Stig Bakken | Date: | Tue, 10 Aug 1999 15:14:22 +0000 |
| Subject: | Re: [PHP4BETA] Re: [PHP3] OO | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-3283@lists.php.net to get a copy of this message | ||
On Mon, 9 Aug 1999, Zeev Suraski wrote:
> At 12:29 09/08/99 , Stig Bakken wrote:
> >On Tue, 3 Aug 1999, Zeev Suraski wrote:
> >
> > > At 21:46 03/08/99 , Sander Pilon wrote:
> > > >Is, or will there be, support for the following things in php3 or php4?
> > > >
> > > >Class constructors/desctructors?
> > > >(I think there are constructors)
> > >
> > > There are constructors, due to the way PHP 4.0 works (reference counted
> > > operation) destructors don't make much sense.
> >
> >You are assuming that the destructor would only free allocated resources.
> >If you want to do something else in a destructor, such as flushing changes
> >to a database, destructors are useful. It can of course be implemented in
> >userland, but it's not exactly something that would be taught in CS
> >courses :-)
>
> I'm not really assuming anything - regardless of what you do in the
> destructor code, there's simply no right way to do it the way PHP is
> implemented; It will either be called too many times, too few times, or on
> the wrong object, completely independent of what you actually perform in
> the destructor.
I have no problems accepting the answer "not technically feasible". But
you have a very good track record of pulling off features that you earlier
described as "extremely difficult" or "almost impossible". :-)
- Stig