This is valid syntax, but it may be the best way to achieve what you are trying to do.
Arrays can have integer, FLOating, Null, Bool and String keys.
In the case of strings, PHP represents them internally as a sequence of bytes, so as far as I know, there is no way to inject vulnerabilities using spaces or special characters for your keys.
However, in my opinion, it makes the code less readable and more error prone by incorrectly typing the key and spending countless hours to find out what you should have entered
$myKey['name=guitar price=200.00']
instead:
$myKey['name=gutiar price=200.00']
the PHP manual page gives a detailed explanation of why this is a bad method:
At some point in the future, the PHP team may want to add another constant or keyword, or a constant in other code may interfere. For example, it is already wrong to use the words empty and default in this way, since they are reserved for keywords.
http://php.net/manual/en/language.types.array.php
source share