Hello Christian,

  Liskov applies to static methods as soon as calls via objects are common
which is true for PHP. Actually in PHP static methods are inherited as any
other method (also true for a lot of other languages). Now given Liskov
rules you can as well add default parameter values as add new parameters
with default values and even change type hints (when respecting the rules
correctly). With C++ the first language has proven that changing default
parameter values is a bad idea. There however mainly because they are bound
at compile time based on the compile time types, which results in default
values that are mostly not what you would expect. In PHP it might work as
expected but then all programmers that come from langiages like C++ get
confused. Also it would disallow a few optimizer things later (going the C++
way of compile time function invocatoin binding). The same holds for new
additional parameters. In most languages that is no option because it would
effectively be a different function. In PHP it would eventually work but add
more confusion that it would help. The last point, changing type hints in
derived class' methods, was discussed at PDM and declined. The main reason
for that decision were that all languages we knew of do not support it and
that most people even do not understand the rules which are quite the
opposite of what most people think.

However the point of adding E_DEPRECATED is still open. Where open only
means which version will first have it. From my perspective that will be
either 5.3.0 or 6.0.0 depending on whetever comes out first. Helping here
would be greatly appreciated.

best regards
marcus

Friday, November 3, 2006, 4:31:52 PM, you wrote:

> Ilia Alshanetsky wrote:
>> Thanks to Hannes we have a fairly complete list of changes in the error
>> conditions, so far people who have commented out it did not appear to
>> have identified anything objectionable. We need to make a decision on
>> how to proceed, either to roll 5.2.0 now or wait another week. My vote
>> is to roll things now...

> Out of curiosity What's the plan for E_DEPRECATED now?

> Regarding the release of PHP 5.2 and OO strictness:
> I never got any comment about my OO strictness patch to not complain
> about adding default values to parameters or changes on static methods
> which both do not break the quoted
> http://en.wikipedia.org/wiki/Liskov_substitution_principle

> I would have hoped for a little info why this patch was not considered.

> Regards,
> - Chris




Best regards,
 Marcus

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to