I agree that the curl_close($ch) should be included. This post is 8 years old so I am afraid I can't satisfy your curiosity about why it's not there in the first place, sorry. Probably carelessness or an attempt to keep the post focussed??