Re: do_declare_property()

From: Date: Wed, 12 Jul 2000 04:21:36 +0000
Subject: Re: do_declare_property()
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-24257@lists.php.net to get a copy of this message
The best is to discuss this before going ahead and implementing it. One of the main reasons we haven't implemented it yet is because we haven't thought of a way it won't cause a significant loss in performance and/or memory increase. Unlike operator overloading I am not against public/private but there are some problems. You need to understand that the reason why it is so difficult to implement such OOP features in PHP vs. Java/C++ is that PHP is so loosely typed and you can't know at compile-time what type a certain object is. I am not sure that the way to implement public/private is to do it in a hackish way. I think maybe a better way (for Zend 1.1/Zend 2.0) is to require the user to define the type of an object similar to Java/C++ if he wants public/private to work. Then we would take care of it at compile-time and not in run-time. You see, this is really the main issue with PHP and many ppl don't understand that there is a reason why certain things are very hard to implement. PHP it just very very loosely typed, Java/C++ have a very easy life when it comes to these kind of things because they are strongly typed and you can know at compile-time EXACTLY what type each variable is and take care of 99% of stuff at compile-time. Right now, it is very important for me to see PHP 4.0 stable; i.e. I want to wait another few mini-versions before making big changes in Zend. In the long run, I think we will make changes similar to public/private but I don't think I personally will advocate the slow-down/increase memory way. I think I will prefer going the "make sure at compile-time" way. If it is important enough to someone to want public/private he must be more than a dumb coder meaning it shouldn't be a big deal to mark what class-type his variables like done in Java/C++. Andi At 01:55 AM 7/12/00 +0200, Mathieu Kooiman (ggInternet) wrote:
Hiya again,, I did some benchmarking just now, strange thing.. My code seemed to have speeded up regular property access (over 4 times 2 different binaries, new code was faster..) But is terribly sucking at 100.000 creations of objects containing private variables. (Heard my machine starting to swap too:-)) So this approach sucks.. wonder how we/I could implement this If you could explain me a bit about this buckets stuff, perhaps we can add a flag in there
        ZEND_IS_PRIVATE
        ZEND_IS_NORMAL
        ZEND_IS_PROTECTED
per example CaPS -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net For additional commands, e-mail: php-dev-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net
--- Andi Gutmans <andi@zend.com> http://www.zend.com/

« previous php.dev (#24257) next »