nategood / httpful

A Chainable, REST Friendly, PHP HTTP Client. A sane alternative to cURL.
MIT License
1.74k stars 299 forks source link

Templating broken by errant unset statement #307

Open sosherof opened 4 months ago

sosherof commented 4 months ago

At the end of Requests->send() is an unset statement that kills the curl handle property ($this->_ch). This throws a warning in PHP 8.x. See PR for fix.

sosherof commented 2 months ago

I see now that this is related to issue #227 (PR #229 ). I think the correct action is to set the _ch object to null so it'll be GC'd and can be reset during the next send operations. Using unset removes the property from the Request object instance and PHP 8 doesn't allow dynamic property creation so the subsequent call to _curlPrep() at the top of send() throws an error.

See PR #306