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) {
這個(gè)變量沒(méi)有初始化, 當(dāng) try cache 發(fā)生異常時(shí), 變量賦值語(yǔ)句沒(méi)執(zhí)行, 就會(huì)發(fā)生變量 未定義, 產(chǎn)生語(yǔ)法錯(cuò)誤了。