@@ -107,7 +107,7 @@ Using Features From the OS Shell
107107
108108Using array of arguments is the recommended way to define commands. This
109109saves you from any escaping and allows sending signals seamlessly
110- (e.g. to stop processesbefore completion )::
110+ (e.g. to stop processeswhile they run )::
111111
112112 $process = new Process(['/path/command', '--option', 'argument', 'etc.']);
113113 $process = new Process(['/path/to/php', '--define', 'memory_limit=1024M', '/path/to/script.php']);
@@ -134,6 +134,17 @@ environment variables using the second argument of the ``run()``,
134134 // On both Unix-like and Windows
135135 $process->run(null, ['MESSAGE' => 'Something to output']);
136136
137+ If you prefer to create portable commands that are independent from the
138+ operating system, you can write the above command as follows::
139+
140+ // works the same on Windows , Linux and macOS
141+ $process = Process::fromShellCommandline('echo "${:MESSAGE}"');
142+
143+ Portable commands require using a syntax that is specific to the component: when
144+ enclosing a variable name into ``"{$: `` and ``}" `` exactly, the process object
145+ will replace it with its escaped value, or will fail if the variable is not
146+ found in the list of environment variables attached to the command.
147+
137148Setting Environment Variables for Processes
138149-------------------------------------------
139150