Skip to content

Commit 6c92c68

Browse files
committed
Add support PHP 8
1 parent 4f9fcce commit 6c92c68

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

src/Transport/CurlerRolling.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,13 @@ public function exec()
288288

289289
// send the return values to the callback function.
290290

291-
$key = (string) $done['handle'];
291+
292+
if (is_object($done['handle'])) {
293+
$key = spl_object_id( $done['handle'] );
294+
} else {
295+
$key = (string) $done['handle'] ;
296+
}
297+
292298
$task_id = $this->handleMapTasks[$key];
293299
$request = $this->pendingRequests[$this->handleMapTasks[$key]];
294300

@@ -367,7 +373,12 @@ private function _prepareLoopQue($task_id)
367373
// pool
368374
curl_multi_add_handle($this->handlerMulti(), $h);
369375

370-
$key = (string) $h;
376+
if (is_object($h)) {
377+
$key = spl_object_id( $h );
378+
} else {
379+
$key = (string) $h ;
380+
}
381+
371382
$this->handleMapTasks[$key] = $task_id;
372383
}
373384
}

0 commit comments

Comments
 (0)