Re: [PHP4BETA] Re: [PHP3] OO

From: Date: Mon, 09 Aug 1999 16:42:20 +0000
Subject: Re: [PHP4BETA] Re: [PHP3] OO
References: 1  Groups: php.version4 
Request: Send a blank email to php-version4+get-3238@lists.php.net to get a copy of this message
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. Zeev -- Zeev Suraski <zeev@zend.com> http://www.zend.com/ For a PGP public key, finger bourbon@netvision.net.il

« previous php.version4 (#3238) next »