public static function run($script, string $cwd = null, array $env = [], string $binary = null): Promise
    {
        $process = new self($script, $cwd, $env, $binary);
        return call(function () use ($process) {
            yield $process->start();
            return $process;
        });
    }
public static function run($script, string $cwd = null, array $env = [], string $binary = null): Promise
    {
        $process = new self($script, $cwd, $env, $binary);
        return call(function () use ($process) {
            yield $process->start();
            return $process;
        });
    }
public static function run ( $ script , string $ cwd = null , array $ env = [ ] , string $ binary = null ) : Promise { $ process = new self ( $ script , $ cwd , $ env , $ binary ) ; return call ( function ( ) use ( $ process ) { yield $ process -> start ( ) ; return $ process ; } ) ; }
Creates and starts the process at the given path using the optional PHP binary path.

@param string|array $script Path to PHP script or array with first element as path and following elements options
to the PHP script (e.g.: ['bin/worker', 'Option1Value', 'Option2Value'].
@param string|null  $cwd Working directory.
@param mixed[]      $env Array of environment variables.
@param string       $binary Path to PHP binary. Null will attempt to automatically locate the binary.

@return Promise<Process>
Creates and starts the process at the given path using the optional PHP binary path .