--TEST-- curl_multi_add_handle does not hold onto the handle on failure --EXTENSIONS-- curl --FILE-- $ch) { curl_multi_remove_handle($mh, $ch); unset($ch); unset($toRemove[$i]); } echo "Removed", PHP_EOL; ?> --EXPECTF-- Removing MyClass::__destruct MyClass::__destruct Removed