hasExtLibevent = extension_loaded('libevent'); } function __invoke() { return $this->select(); } function select() { if ($this->hasExtLibevent) { $reactor = new LibeventReactor; } else { $reactor = new NativeReactor; } return $reactor; } }