On 11/09/2013 13:16, jbo...@openmv.com wrote:
I'm still undecided about 'mixing' positional & named arguments: An
example use case for **kwargs here:
http://www.python-requests.org/en/latest/api/ If you declare:
request($method, $url, ...$args) Would $args collect 'method' and
'url' ? request(method => 'post', url => 'foo/');
No. With positional arguments:
function foo($bar, $foobar, ...$x) {}
foo(1, 2);
Then $x will be empty, since it only collects "left-over" arguments, I
suppose. The same applies for named arguments. In the case you used,
$args would be empty, as $method and $url pick up those named arguments.
----
Andrea Faulds
http://ajf.me/
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php