| @@ -98,9 +98,11 @@ | ||
| 98 | 98 | { |
| 99 | 99 | $resource = $easy->handle; |
| 100 | 100 | unset($easy->handle); |
| 101 | 101 | if (\count($this->handles) >= $this->maxHandles) { |
| 102 | - \curl_close($resource); | |
| 102 | + if (\PHP_VERSION_ID < 80000) { | |
| 103 | + \curl_close($resource); | |
| 104 | + } | |
| 103 | 105 | } else { |
| 104 | 106 | // Remove all callback functions as they can hold onto references |
| 105 | 107 | // and are not cleaned up by curl_reset. Using curl_setopt_array |
| 106 | 108 | // does not work for some reason, so removing each one |
| @@ -555,9 +557,11 @@ | ||
| 555 | 557 | } |
| 556 | 558 | public function __destruct() |
| 557 | 559 | { |
| 558 | 560 | foreach ($this->handles as $id => $handle) { |
| 559 | - \curl_close($handle); | |
| 561 | + if (\PHP_VERSION_ID < 80000) { | |
| 562 | + \curl_close($handle); | |
| 563 | + } | |
| 560 | 564 | unset($this->handles[$id]); |
| 561 | 565 | } |
| 562 | 566 | } |
| 563 | 567 | } |