Not really, you lose most of the validation and documentation, you get 2 levels of parameters (first-class positionals and second-class keywords), you may not correctly detect or handle redundant provisions, defaults may or may not work the same way (and correctly), and it's not possible to provide through keywords a parameter the function's implementer has defined as positional, even if that's clearer for the callsite.
It works-ish, but it is and remains a hack and a pale shadow of first-class keyword parameters.
On the other hand, I can get behind the inverse: keyword-only parameters and positionals by abusing arrays (à la Smalltalk, Self or Objective-C), in my experience that significantly increases the code's readability and flexibility. Though it hardly plays nicely with partial application.
> That also has the additional benefit that the user of a function can reuse the config array
parameter packing & unpacking takes care of that, it's not an advantage of "a single associative array".
> the amount of boilerplate you save by making named parameters first class is tiny
To get the same functionality as e.g. Python's kwargs, we're probably talking about half a dozen lines. In each function. That's not tiny.
Not sure what you're talking about. When somebody talks about "boilerplate", it's very much about the number of (setup/redundant) expressions/tokens having to be used to do something.
> Please show an example of how this is saving lines in a way that's not comprable to simply doing multiple assigns on one line (ie: destroying readability).
I would suggest actually reading my comment, that may give you a hint as to what I'm comparing and let you understand on your own how different it is.
This is only true if you don't replace these forms of documentation with something better, which I'd do.
* Documenting a hash-hack will still require spelling out that one of the positional parameters is a hash, then diving into that hash to spell out the various keys. This adds one worthless level of indirections to first-class keyword parameters, which can just treat all parameters the same way for documentary purposes.
func([$arg1,'name2'=>$arg2,$arg3]);
is too verbose for you for a mix of named and non-named parameters? How would you shorten it?
func(array("arg1", "name2"=>"arg2", "arg3"));
Which is much "uglier" than the new syntax.
That doesn't sound like a legitimate reason to me. It's not javascript. So what?
array( => , => , ...) is "preposterously verbose?
You should see some other languages for the "preposterously" part.
Plus 5.4 has short array syntax.