// Clone to prevent a circular reference
$multi =
clone $this;
$multi->handle = null;
$multi->share = null;
$multi->pushedResponses = &
$this->pushedResponses;
$multi->logger = &
$this->logger;
$multi->handlesActivity = &
$this->handlesActivity;
$multi->openHandles = &
$this->openHandles;
curl_multi_setopt($this->handle, \CURLMOPT_PUSHFUNCTION,
static fn ($parent,
$pushed, array
$requestHeaders) =>
$multi->
handlePush($parent,
$pushed,
$requestHeaders,
$maxPendingPushes));
} public function reset(): void
{ foreach ($this->pushedResponses
as $url =>
$response) { $this->logger?->
debug(sprintf('Unused pushed response: "%s"',
$url));
curl_multi_remove_handle($this->handle,
$response->handle
);
curl_close($response->handle
);
} $this->pushedResponses =
[];