private static function _readln() { $line = fgets(self::$controlSocket); if ($line === false) { self::_setError(-1, 'fgets failed in _readln'); return false; } if (strlen($line) == 0) { return $line; } $patch = array(); if (preg_match("/^[0-9][0-9][0-9] /", $line, $patch)) { self::$lastResult = intval($patch[0]); self::$newResult = true; if (substr($patch[0], 0, 1) == '5') { self::_setError(self::$lastResult, trim(substr($line, 4))); } } self::$lastLine = trim($line); return $line; }