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

Re: [PHP-DEV] __constructor parameter limitations.

2011-09-17 Thread Nikita Popov
On Sat, Sep 17, 2011 at 11:39 PM, Richard Quadling 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 for methods define

Re: [PHP-DEV] __constructor parameter limitations.

2011-09-17 Thread Richard Quadling
On 17 September 2011 15:52, Ferenc Kovacs 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 > wrote: >> Hi Richard! >> >> Which change are you talking abou

Re: [PHP-DEV] __constructor parameter limitations.

2011-09-17 Thread Etienne Kneuss
On Sat, Sep 17, 2011 at 20:08, Stas Malyshev wrote: > Hi! > > On Sat, Sep 17, 2011 at 17:08, Laruence wrote: >> >>> class A { public function init($a, $b) { } } class B extends A { public function init($a) { } } => PHP Strict Standards: Declaration of B::init() s

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 wro

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, Laruence 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 compa

Re: [PHP-DEV] __constructor parameter limitations.

2011-09-17 Thread Stas Malyshev
Hi! On Sat, Sep 17, 2011 at 17:08, Laruence 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 reason for this?

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 Su

Re: [PHP-DEV] __constructor parameter limitations.

2011-09-17 Thread Laruence
2011/9/17 Etienne Kneuss : > > > On Sat, Sep 17, 2011 at 17:15, Laruence 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 whe

Re: [PHP-DEV] __constructor parameter limitations.

2011-09-17 Thread Etienne Kneuss
On Sat, Sep 17, 2011 at 17:15, Laruence 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. > Well, that is

Re: [PHP-DEV] __constructor parameter limitations.

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

Re: [PHP-DEV] __constructor parameter limitations.

2011-09-17 Thread Etienne Kneuss
On Sat, Sep 17, 2011 at 17:08, Laruence wrote: > 2011/9/17 : > > 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) { } } > > > > => PH

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 Laruence
2011/9/17 : > 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 wi

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 wrote: > Hi Richard! > > Which change are you talking about? I just tried doing: >        class A           { public functio

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 ex

Re: [PHP-DEV] __constructor parameter limitations.

2011-09-17 Thread Nikita Popov
Hi Richard! Which change are you talking about? I just tried doing: wrote: > 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 th

[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 lim