private static function callHandler(int
$index,
$value, array
$handler): void
{ /** @var PromiseInterface $promise */
$promise =
$handler[0
];
// The promise may have been cancelled or resolved before placing
// this thunk in the queue.
if (Is::
settled($promise)) { return;
} try { if (isset($handler[$index])) { /*
* If $f throws an exception, then $handler will be in the exception
* stack trace. Since $handler contains a reference to the callable
* itself we get a circular reference. We clear the $handler
* here to avoid that memory leak.
*/