It’s pretty simple really.
instead of doing this..
you can then do this
export ENVIRONMENT_VAR=test; php application.php
Getting this variable from within PHP is easy - just do a search for the getenv() function ;)
Ok, this works too, with the added advantage of not setting the variable permanently!
ENVIRONMENT_VAR=test php application.php
Note that there are no semi colons between the variable and the php command.