PHP Fatal error: Uncaught ErrorException: Undefined variable: ret in /btc/okcoin/vendor/workerman/workerman/Events/Select.php:284
while (1) {
if(\DIRECTORY_SEPARATOR === '/') {
// Calls signal handlers for pending signals
\pcntl_signal_dispatch();
}
$read = $this->_readFds;
$write = $this->_writeFds;
$except = $this->_exceptFds;
if ($read || $write || $except) {
// Waiting read/write/signal/timeout events.
try {
$ret = @stream_select($read, $write, $except, 0, $this->_selectTimeout);
} catch (\Exception $e) {} catch (\Error $e) {}
} else {
usleep($this->_selectTimeout);
$ret = false;
}
if (!$this->_scheduler->isEmpty()) {
$this->tick();
}
=======> if (!$ret) {
continue;
}
284行代碼:
if (!$ret) {
這個變量沒有初始化, 當(dāng) try cache 發(fā)生異常時, 變量賦值語句沒執(zhí)行, 就會發(fā)生變量 未定義, 產(chǎn)生語法錯誤了。