Using PHP 5.3 if I send a JSON encoded string as an arugment via command line...
/usr/local/bin/php -q /path/to/script.php {"key":"test","cache":1}
... and in script.php the code is:
<?php print_r($argv); ?>
I get back:
Array
(
[0] => /path/to/script.php
[1] => key:test
[2] => cache:1
)
Which is completely unexpected!
Whilst I can live with this I'd like to know where this is documented by PHP so that I am 100% sure it will work like this if I pass a JSON encoded string as an argument every time.
Also arrays within the JSON string don't seem to work as expected.