public function getExitCode()
    {
        if ($this->exitcode === null && $this->process !== null) {
            $status = proc_get_status($this->process);
            if ($status && $status['running'] === false) {
                $this->exitcode = $status['exitcode'];
            }
        }

        return $this->exitcode;
    }