So it looks like `json_to_array.sh --assign --clip` (if no clip just echoes the resulting PHP to stdout)
https://kopy.io/aLpar (its not good code, it's an itch scratcher) - only works on Linux (it's all I use but would be trivial to make it work on a Mac I think).
PHP makes a really good shell scripting language since it's a full blown language with a massive API and can 'talk' to the shell quite simply.