as of PHP 7.4.0 with libcurl >= 7.56.0, CurlFile accepts any supported
stream URLs (formerly it only accepted file names). There is, however,
a bug in the current implementation which breaks the upload for copied
cURL handles (curl_copy_handle()). A pull request to fix this is
Now the question came up, whether we should open these streams lazily
(i.e. only when libcurl needs it; basically the same behavior like PHP
7.3), or whether the streams should be opened in advance. The latter
would have the advantage that we easily could resolve bug #79013
(which may not be a bug at all), but the drawback that there may be more
open streams than strictly necessary.
I tend to prefer the current solution (i.e. open the streams lazily),
but would like to hear more opinions on that.