php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #61911 Other behavior than documented
Submitted: 2012-05-02 18:04 UTC Modified: 2013-10-09 06:30 UTC
From: richard dot berger at gmx dot de Assigned: krakjoe (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: Debian 6.0.4, PHP 5.3.3
Private report: No CVE-ID: None
 [2012-05-02 18:04 UTC] richard dot berger at gmx dot de
Description:
------------
---
From manual page: http://www.php.net/function.curl-setopt#refsect1-function.curl-setopt-parameters
---

"CURLOPT_FAILONERROR - TRUE to fail silently if the HTTP code returned is greater than or equal to 400. The default behavior is to return the page normally, ignoring the code."

It's the opposite, I had to set it to true, to not fail silently.

--> it must be:

"CURLOPT_FAILONERROR - TRUE to NOT fail silently if the HTTP code returned is greater than or equal to 400. The default behavior is to return the page normally, ignoring the code."


Test script:
---------------
<?
$ch = curl_init();

//curl_setopt($ch, CURLOPT_FAILONERROR, false);
curl_setopt($ch, CURLOPT_FAILONERROR, true);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL, "http://some.host/non-existing-ressource/");

if (!curl_exec($ch)) {
    echo "non existing resource";
}

Expected result:
----------------
No output from the echo command.

Actual result:
--------------
The echo command "non existing ressource" is executed when requesting a non existing http ressource. According to the documentation this shouldnt be the case if CURLOPT_FAILONERROR is TRUE.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-10-09 06:30 UTC] krakjoe@php.net
Automatic comment from SVN on behalf of krakjoe
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=331739
Log: #61911 incorrect description of option constant
 [2013-10-09 06:30 UTC] krakjoe@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: krakjoe
 [2013-10-09 06:30 UTC] krakjoe@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Wed Oct 07 17:00:02 2026 UTC