From c798efed79ef7482497006b970f699b3f01979fb Mon Sep 17 00:00:00 2001 From: Aaron Piotrowski Date: Sun, 8 Apr 2018 22:02:03 -0500 Subject: [PATCH] Add version check --- lib/Loop.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Loop.php b/lib/Loop.php index fd0abdbf..d313f221 100644 --- a/lib/Loop.php +++ b/lib/Loop.php @@ -247,7 +247,7 @@ public static function enable(string $watcherId) { * @return void */ public static function disable(string $watcherId) { - if (!isset(self::$driver)) { + if (\PHP_VERSION_ID < 70200 && !isset(self::$driver)) { // Prior to PHP 7.2, self::$driver may be unset during destruct. // See https://github.com/amphp/amp/issues/212. return; @@ -267,7 +267,7 @@ public static function disable(string $watcherId) { * @return void */ public static function cancel(string $watcherId) { - if (!isset(self::$driver)) { + if (\PHP_VERSION_ID < 70200 && !isset(self::$driver)) { // Prior to PHP 7.2, self::$driver may be unset during destruct. // See https://github.com/amphp/amp/issues/212. return; @@ -303,7 +303,7 @@ public static function reference(string $watcherId) { * @return void */ public static function unreference(string $watcherId) { - if (!isset(self::$driver)) { + if (\PHP_VERSION_ID < 70200 && !isset(self::$driver)) { // Prior to PHP 7.2, self::$driver may be unset during destruct. // See https://github.com/amphp/amp/issues/212. return;