Posted by Jerry Stuckle on 06/25/06 03:00
David Haynes wrote:
> Jerry Stuckle wrote:
>
>> PHP does have some polymorphic-like abilities, but that's because of
>> the untyped nature of the variables.
>>
>> PHP is getting better in it's OO aspects, but I doubt it will ever be
>> quite like Java. There's just a basic difference between languages
>> with typed and untyped variables.
>
>
> I was thinking about this the other day and it may not be all that
> difficult to add it.
>
> Consider that you can already type the arguments to the constructor.
> Given this, it would not be all that hard to derive a typed signature
> which could then be applied.
>
> -david-
>
I really don't know how hard it would be to add - but I would like to see it
added. One thing I don't like all that much is the untyped variables. It makes
things "easy" - but leads to some sloppy programming.
It also means you can't overload functions - at least not with the same number
of parms. Typing the constructor arguments is a good start. But expanding that
to other functions without breaking existing code might be more difficult.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
[Back to original message]
|