|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48965 curl is not able to post a string properly from a cloned handle
Submitted: 2009-07-18 07:10 UTC Modified: 2009-07-28 18:54 UTC
From: sriram dot natarajan at gmail dot com Assigned: srinatar (profile)
Status: Not a bug Package: cURL related
PHP Version: 5.*, 6CVS (2009-07-22) OS: *
Private report: No CVE-ID: None
 [2009-07-18 07:10 UTC] sriram dot natarajan at gmail dot com
currently, within php tests, the following tests are marked as 'expected failures'


which both does some thing like

curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "Hello=World&Foo=Bar&Person=John%20Doe");

  $copy = curl_copy_handle($ch);
  $curl_content_copy = curl_exec($copy);

  var_dump( $curl_content_copy );

Expected result:
these tests should pass fine.

Actual result:
string(163) "array(1) {
  string(7) "getpost"


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-07-20 09:42 UTC]
only PHP_5_3 and HEAD? Not PHP_5_2..?
 [2009-07-20 14:55 UTC]
See also bug #48774
 [2009-07-21 20:45 UTC]
yes, this is an issue with HEAD, 5.2 and 5.3

- sriram
 [2009-07-25 22:15 UTC]
The reason is explained here:

You can not close the original handle before doing curl_exec($copy)..
 [2009-07-28 12:19 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

This is a cURL limitation..
 [2009-07-28 18:54 UTC]
should these below test cases be removed as it is doing some thing which is not supported or standard behavior ?


just curious as to what is the practice in this case ?
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Jun 13 06:01:23 2021 UTC