diff --git a/src/CallbackWrapper.php b/src/CallbackWrapper.php index c5847b9..4eef556 100644 --- a/src/CallbackWrapper.php +++ b/src/CallbackWrapper.php @@ -107,6 +107,8 @@ public function stream_close() { $result = parent::stream_close(); if (is_callable($this->closeCallback)) { call_user_func($this->closeCallback); + // prevent further calls by potential PHP 7 GC ghosts + $this->closeCallback = null; } return $result; }