httpful icon indicating copy to clipboard operation
httpful copied to clipboard

Templating broken by errant unset statement

Open sosherof opened this issue 2 years ago • 1 comments

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 avatar Mar 13 '24 14:03 sosherof

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

sosherof avatar May 01 '24 14:05 sosherof