Pass KM Variables to PHP in Command Line

One way to pass KM variables to PHP variables is to use the $_ENV variable. See the example in my post:
Please Consider Adding "Get KM Variable in PHP" to the Wiki Scripting Page - Forum Admin - Keyboard Maestro Discourse

If we run php from command line, we can pass KM variables in such way:

Make a php file, named test.php. I save it to '~/Dropbox/Scripting/php/'.

$var = getopt("p:q:");
echo var_dump($var);

Make a KM macro as such:

The value of LocalVar1 in KM will become the value of $p.
The value of LocalVar2 in KM will become the value of $q.

Result of the macro: