[PHP-DEV] __constructor parameter limitations.

2011-09-17 Thread Richard Quadling
Hi. With the recent BC with regard the locking of the constructor's signature for subclasses, what is the expected mechanism for allowing a subclass to have additional parameters? You can always supply them and use func_get_args() / func_num_args() / etc. to read them. It would seem that the

Re: [PHP-DEV] __constructor parameter limitations.

2011-09-17 Thread Nikita Popov
Hi Richard! Which change are you talking about? I just tried doing: ?php class A { public function __construct($a) { } } class B extends A { public function __construct($a, $b) { } } And it worked on 5.4 Beta 1 without errors. Nikita On Sat, Sep 17, 2011 at 3:27 PM,

Re: [PHP-DEV] __constructor parameter limitations.

2011-09-17 Thread devis
Hi, I think Richards intended other methods often used in combination with __construct: class A { public function init($a, $b) { } } class B extends A { public function init($a) { } } = PHP Strict Standards: Declaration of B::init() should be compatible with that of A::init() The

Re: [PHP-DEV] __constructor parameter limitations.

2011-09-17 Thread Ferenc Kovacs
maybe Richard referring to https://bugs.php.net/bug.php?id=55085 ? but those change only affects the abstract classes. Tyrael On Sat, Sep 17, 2011 at 3:43 PM, Nikita Popov nikita@googlemail.com wrote: Hi Richard! Which change are you talking about? I just tried doing:    ?php    class A

Re: [PHP-DEV] __constructor parameter limitations.

2011-09-17 Thread Laruence
2011/9/17 de...@lucato.it: Hi, I think Richards intended other methods often used in combination with __construct: class A           { public function init($a, $b) { } } class B extends A { public function init($a) { } } = PHP Strict Standards:  Declaration of B::init() should be

Re: [PHP-DEV] __constructor parameter limitations.

2011-09-17 Thread Laruence
Hi: this is really a big bc break...(fatal error) is there any reason for us to really change this? In Yaf, there are a lot of Abstract classes, the subclass only need declared there argument when they really need it. and I really not think this change is good one, the Intenal class can

Re: [PHP-DEV] __constructor parameter limitations.

2011-09-17 Thread Etienne Kneuss
On Sat, Sep 17, 2011 at 17:08, Laruence larue...@php.net wrote: 2011/9/17 de...@lucato.it: Hi, I think Richards intended other methods often used in combination with __construct: class A { public function init($a, $b) { } } class B extends A { public function init($a) {

Re: [PHP-DEV] __constructor parameter limitations.

2011-09-17 Thread Laruence
2011/9/17 Etienne Kneuss col...@php.net: On Sat, Sep 17, 2011 at 17:08, Laruence larue...@php.net wrote: 2011/9/17  de...@lucato.it: Hi, I think Richards intended other methods often used in combination with __construct: class A           { public function init($a, $b) { } }

Re: [PHP-DEV] __constructor parameter limitations.

2011-09-17 Thread Etienne Kneuss
On Sat, Sep 17, 2011 at 17:15, Laruence larue...@php.net wrote: Hi: this is really a big bc break...(fatal error) is there any reason for us to really change this? In Yaf, there are a lot of Abstract classes, the subclass only need declared there argument when they really need it.

Re: [PHP-DEV] __constructor parameter limitations.

2011-09-17 Thread Laruence
2011/9/17 Etienne Kneuss col...@php.net: On Sat, Sep 17, 2011 at 17:15, Laruence larue...@php.net wrote: Hi:  this is really a big bc break...(fatal error)  is there any reason for us to really change this?   In Yaf, there are a lot of Abstract classes,  the subclass only need declared

Re: [PHP-DEV] __constructor parameter limitations.

2011-09-17 Thread Ferenc Kovacs
 do you know any reason for this? The reason for this is simply that B must act like A since every B object is also an object of A. The reason for restricting the method signature in the Subclass is to guarantee that an instance of a Subclass should work where an instance of the Superclass

Re: [PHP-DEV] __constructor parameter limitations.

2011-09-17 Thread Stas Malyshev
Hi! On Sat, Sep 17, 2011 at 17:08, Laruencelarue...@php.net wrote: class A { public function init($a, $b) { } } class B extends A { public function init($a) { } } = PHP Strict Standards: Declaration of B::init() should be compatible with that of A::init() do you know any

Re: [PHP-DEV] __constructor parameter limitations.

2011-09-17 Thread Reindl Harald
Am 17.09.2011 20:08, schrieb Stas Malyshev: Hi! On Sat, Sep 17, 2011 at 17:08, Laruencelarue...@php.net wrote: class A { public function init($a, $b) { } } class B extends A { public function init($a) { } } = PHP Strict Standards: Declaration of B::init() should be

Re: [PHP-DEV] __constructor parameter limitations.

2011-09-17 Thread Stas Malyshev
Hi! On 9/17/11 6:27 AM, Richard Quadling wrote: With the recent BC with regard the locking of the constructor's signature for subclasses, what is the expected mechanism for allowing a subclass to have additional parameters? I think the whole strict parameters thing has gone into somewhat

Re: [PHP-DEV] __constructor parameter limitations.

2011-09-17 Thread Etienne Kneuss
On Sat, Sep 17, 2011 at 20:08, Stas Malyshev smalys...@sugarcrm.com wrote: Hi! On Sat, Sep 17, 2011 at 17:08, Laruencelarue...@php.net wrote: class A { public function init($a, $b) { } } class B extends A { public function init($a) { } } = PHP Strict Standards: Declaration

Re: [PHP-DEV] __constructor parameter limitations.

2011-09-17 Thread Richard Quadling
On 17 September 2011 15:52, Ferenc Kovacs tyr...@gmail.com wrote: maybe Richard referring to https://bugs.php.net/bug.php?id=55085 ? but those change only affects the abstract classes. Tyrael On Sat, Sep 17, 2011 at 3:43 PM, Nikita Popov nikita@googlemail.com wrote: Hi Richard!

Re: [PHP-DEV] __constructor parameter limitations.

2011-09-17 Thread Nikita Popov
On Sat, Sep 17, 2011 at 11:39 PM, Richard Quadling rquadl...@gmail.com wrote: My question was due to the documentation commit http://news.php.net/php.doc.cvs/8818 and http://news.php.net/php.doc.cvs/8819. Just to clarify (as I'm not sure you got that change right): PHP has enforced signatures

Re: [PHP-DEV] __constructor parameter limitations.

2011-09-17 Thread Stas Malyshev
Hi! On 9/17/11 2:39 PM, Richard Quadling wrote: An interface is the absolute here. Sub classes (the super class being abstract or otherwise), should be able to define MORE parameters (with or without default values). Otherwise they aren't extending, but implementing - and for me that's the role