Re: [RFC] OOP API for cURL extension
| From: | Rowan Tommins | Date: | Fri, 16 Feb 2024 16:09:32 +0000 |
| Subject: | Re: [RFC] OOP API for cURL extension | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-122397@lists.php.net to get a copy of this message | ||
On 15 February 2024 15:44:13 GMT, Sara Golemon <pollita@php.net> wrote:
>* CurlHandle::exec() mixed typing of return values.
> Comment: Agreed. The
true return value becomes meaningless in
> the
>RETURNTRANSFER==false case.
> Proposal: Update the RFC for CurlHandle::execute() to return ?string.
Should we take this a step further, and remove CURLOPT_RETURNTRANSFER as a valid option on the
object completely? Instead of an overloaded exec() method, provide:
public function executeAndReturn(): string
public function executeAndOutput(): void
Perhaps the option could be accepted in the relevant setOpt methods, but issue a warning that it has
no effect.
Since both the default for the option and the name of the method are changing anyway, I don't
think this significantly affects the migration effort for the tiny minority of cases where you
actually want the direct output behaviour.
Regards,
--
Rowan Tommins
[IMSoP]