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