Re: [PHP-DEV] [Question] Variadic method signature compatibility between 5.6 and 7.0

2015-11-03 Thread Rowan Collins
Rowan Collins wrote on 03/11/2015 09:20: That's not equivalent, because the version with no arguments explicitly prohibits zero arguments, which the variadic signature doesn't. Sorry, this should read "the version with no arguments explicitly prohibits passing one argument". -- PHP

Re: [PHP-DEV] [Question] Variadic method signature compatibility between 5.6 and 7.0

2015-11-03 Thread Rowan Collins
Marc Bennewitz wrote on 02/11/2015 19:44: Hi Rowan, On 11/02/2015 05:41 PM, Rowan Collins wrote: Alexander Lisachenko wrote on 02/11/2015 11:12: First definition declares exactly one single parameter, which can be absent during the method call, so I can even write public static function

Re: [PHP-DEV] [Question] Variadic method signature compatibility between 5.6 and 7.0

2015-11-02 Thread Rowan Collins
Alexander Lisachenko wrote on 02/11/2015 11:12: First definition declares exactly one single parameter, which can be absent during the method call, so I can even write public static function test() {} Second definition defines zero or more arguments, so it can be also described by the same

Re: [PHP-DEV] [Question] Variadic method signature compatibility between 5.6 and 7.0

2015-11-02 Thread Marc Bennewitz
Hi Rowan, On 11/02/2015 05:41 PM, Rowan Collins wrote: Alexander Lisachenko wrote on 02/11/2015 11:12: First definition declares exactly one single parameter, which can be absent during the method call, so I can even write public static function test() {} Second definition defines zero or

Re: [PHP-DEV] [Question] Variadic method signature compatibility between 5.6 and 7.0

2015-11-02 Thread Rowan Collins
Alexander Lisachenko wrote on 01/11/2015 21:49: class Foo { public static function test($bar = null) { var_dump(func_get_args()); } } class Baz extends Foo { public static function test(...$args) { parent::test(...$args); } } [...] From userland point of

Re: [PHP-DEV] [Question] Variadic method signature compatibility between 5.6 and 7.0

2015-11-02 Thread Alexander Lisachenko
2015-11-02 12:22 GMT+03:00 Rowan Collins : > Should they? func_get_args() can be used to simulate any function > signature, so you could equally say that the following are "compatible": Hello! Thank you for the answer. However, question is not about func_get_args() at

[PHP-DEV] [Question] Variadic method signature compatibility between 5.6 and 7.0

2015-11-01 Thread Alexander Lisachenko
Hello, internals! I have a question about changed behavior in 7.0 for matching signature of variadic method. Here is an example of code: class Foo { public static function test($bar = null) { var_dump(func_get_args()); } } class Baz extends Foo { public static function