Date: 07/12/00
- Next message: Andi Gutmans: "Re: [PHP-DEV] do_declare_property()"
- Previous message: Troels Arvin: "[PHP-DEV] Patch: Making ldap compile as a shared module"
- In reply to: Mathieu Kooiman (ggInternet): "Re: [PHP-DEV] do_declare_property()"
- Next in thread: Mathieu Kooiman (ggInternet): "Re: [PHP-DEV] do_declare_property()"
- Reply: Mathieu Kooiman (ggInternet): "Re: [PHP-DEV] do_declare_property()"
- Reply: waldschrott: "Re: [PHP-DEV] do_declare_property()"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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 <email protected>
>For additional commands, e-mail: php-dev-help <email protected>
>To contact the list administrators, e-mail: php-list-admin <email protected>
--- Andi Gutmans <andi <email protected>> http://www.zend.com/-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Andi Gutmans: "Re: [PHP-DEV] do_declare_property()"
- Previous message: Troels Arvin: "[PHP-DEV] Patch: Making ldap compile as a shared module"
- In reply to: Mathieu Kooiman (ggInternet): "Re: [PHP-DEV] do_declare_property()"
- Next in thread: Mathieu Kooiman (ggInternet): "Re: [PHP-DEV] do_declare_property()"
- Reply: Mathieu Kooiman (ggInternet): "Re: [PHP-DEV] do_declare_property()"
- Reply: waldschrott: "Re: [PHP-DEV] do_declare_property()"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

