public function __destruct() { if (posix_getpid() === $this->pid) { $this->setState(Daemon::WSTATE_SHUTDOWN); } }