4 ms·
You mean 5.4's associative array syntax: func([$arg1,'name2'=>$arg2,$arg3]); is too verbose for you for a mix of named and non-named parameters? How would you
by rll 14y ago
You mean 5.4's associative array syntax:
func([$arg1,'name2'=>$arg2,$arg3]);
is too verbose for you for a mix of named and non-named parameters? How would you shorten it?
- gburt 14y agoIt's much improved in 5.4. I think the grandparent post's point was that prior to 5.4, this would've looked like func(array("arg1", "name2"=>"arg2", "arg3")); Which is much "uglier" than the new syntax.
- mistercow 14y agoOh, yes 5.4 is a bit improved, but how would I shorten it? I'd drop the quotes around 'name2' whenever it was a legal identifier, and I'd ditch the hideous => symbol.
- pacmon 14y agoI think dropping the quotes is a bad idea. This isn't javascript. However, I do agree about the => symbol. I would have preferred if in 5.4 they added support for ':' so, ['a':$b]. At which point, I'm sure someone will say that looks so similar to js syntax, why not drop the quotes? To which I say -personally- I just think it leads to more confusion. (Although for some reason I don't mind that in js - I know.. weird preferences.)
- mistercow 14y ago>I think dropping the quotes is a bad idea. This isn't javascript. That doesn't sound like a legitimate reason to me. It's not javascript. So what?