public function send($input)
    {
        if (!$this->isAlive()) {
            throw new LogicException('Process is not alive.');
        } elseif (!$this->interactive) {
            throw new LogicException("Process [{$this->pid}] not running interactively.");
        }

        $bytes = fwrite($this->pipes[static::STDIN], $input, strlen($input));
        if ($bytes === false) {
            $this->kill();
            throw new ProcessException("Error sending [$input] to $this stdin.", $this);
        }
    }
public function send($input)
    {
        if (!$this->isAlive()) {
            throw new LogicException('Process is not alive.');
        } elseif (!$this->interactive) {
            throw new LogicException("Process [{$this->pid}] not running interactively.");
        }

        $bytes = fwrite($this->pipes[static::STDIN], $input, strlen($input));
        if ($bytes === false) {
            $this->kill();
            throw new ProcessException("Error sending [$input] to $this stdin.", $this);
        }
    }
public function send ( $ input ) { if ( ! $ this -> isAlive ( ) ) { throw new LogicException ( 'Process is not alive.' ) ; } elseif ( ! $ this -> interactive ) { throw new LogicException ( "Process [{$this->pid}] not running interactively." ) ; } $ bytes = fwrite ( $ this -> pipes [ static :: STDIN ] , $ input , strlen ( $ input ) ) ; if ( $ bytes === false ) { $ this -> kill ( ) ; throw new ProcessException ( "Error sending [$input] to $this stdin." , $ this ) ; } }
Sends the text to the interactive process via its stdin.

@param string $input
@throws LogicException
@throws ProcessException
Sends the text to the interactive process via its stdin .