Em Mon, 19 Sep 2011 10:01:32 +0100, Etienne Kneuss <col...@php.net>
escreveu:
Sure, but you mix two things here, references would have to be handled
specifically, and we would not allow to specify less args by ref.
There is simply no reason for disallowing this with nornal args though.
Imagine the following code:
interface Foo { public function plop ($a,$b,$c,$d) }
class A implements Foo {
public function plop() {
$args = func_get_args();
// ...
}
}
This is perfectly valid PHP code, there is no valid usage of Foo that
will not work with A... So to me this restriction seems really arbitrary.
And I don;t believe missing an argument in the declaration of a method,
using it in the body of the method and not realising it is so much of a
common error that it would warrant this.
Arbitrary as it may be, it's nevertheless reasonably arbitrated given how
little useful it is to just ignore arguments and how likely it is to a
mistake.
And I don't buy the func_get_args() argument. Why would anyone use
func_get_args for anything other than variadic functions?... I certainly
don't.
--
Gustavo Lopes
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php