Here\'s what I am trying to accomplish:
function foo($args) {
switch($args[\'type\']) {
case \'bar\':
bar($args[\'data\']); // do something
break;
No, there is no "short-syntax" to write arrays nor objects, in PHP : you have to write all those array()
.
(At least, there is no such syntax... yet ; might come in a future version of PHP ; who knows ^^ )
But note that have too many imbricated arrays like that will makes things harder for people who will have to call your functions : using real-parameters means auto-completion and type-hinting in the IDE...