Marcus Boerger wrote:
[EMAIL PROTECTED] /usr/src/PHP_5_1 $ php -r 'class T{function f($x){}} class U 
extends T{function f($x=2){}}'
make: `sapi/cli/php' is up to date.

Strict Standards: Declaration of U::f() should be compatible with that of 
T::f() in Command line code on line 1
[EMAIL PROTECTED] /usr/src/PHP_5_1 $ php -r 'class T{function f($x=1){}} class 
U extends T{function f($x=2){}}'
make: `sapi/cli/php' is up to date.

The above shows php is correct here.

In my opinion Sean didn't ask whether PHP behaves that way but _why_.

And I don't really see the point either as U::f works with all code previously using T::f. Even more so for function V::f($x,$y=false) to provide extended functionality to T::f($x) for code which knows about it. And why would changing the default value be ok in your book? But then again I'm not an OO purist and I don't (have to) use E_STRICT.

- Chris

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

Reply via email to