public function stop($timeout = 1000)
    {
        $timeout = microtime(true) + ($timeout * 1000);

        if ($this->isRunning()) {
            proc_terminate($this->proc);
        }
        while ($this->isRunning() && microtime(true) < $timeout) {
            usleep(1000);
        }

        $this->readOutput();
        $this->readError();

        return $this;
    }
public function stop($timeout = 1000)
    {
        $timeout = microtime(true) + ($timeout * 1000);

        if ($this->isRunning()) {
            proc_terminate($this->proc);
        }
        while ($this->isRunning() && microtime(true) < $timeout) {
            usleep(1000);
        }

        $this->readOutput();
        $this->readError();

        return $this;
    }
public function stop ( $ timeout = 1000 ) { $ timeout = microtime ( true ) + ( $ timeout * 1000 ) ; if ( $ this -> isRunning ( ) ) { proc_terminate ( $ this -> proc ) ; } while ( $ this -> isRunning ( ) && microtime ( true ) < $ timeout ) { usleep ( 1000 ) ; } $ this -> readOutput ( ) ; $ this -> readError ( ) ; return $ this ; }
Stop a process

@param int $timeout in ms

@return $this
Stop a process