Jakes Potgieter wrote:
> It would be nice to have a base class to inherit some special
> methods as we do in Java.
could you name which ones you think of?
being out of the JAVA camp for several years know i no longer
know all java.object methods and properties by heart, but
PHP mechanisms like __sleep()/__wakeup(), __toString() and
the introspection related functions like get_class() and
friends should provide comparable behaviour ...
(IMHO the fact that any object in JAVA can be casted down
to java.object is not that clever after all, and part of it
is only due to the fact that there is no other way to have
portable container classes, which is now finally solved
with generics)
> The same as method overloading,
> one of the most important aspects missing in PHP5 and the
> new object model.
due to the feature of optional parameters you may end up with
more than one overloaded function matching a call signature,
due to the fact that argument types in a function call
are not known at compile time signature matching would have
to happen at runtime,
and the language syntax would need to be extended to add
parameter type specifiers to function parameter declarations
(ok, we already have this one for interfaces ...)
--
Hartmut Holzgraefe <hartmut@php.net>