php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #63800 CURLOPT_MUTE not defined but mentioned on http://nz1.php.net/manual/en/function
Submitted: 2012-12-18 21:35 UTC Modified: 2012-12-18 22:23 UTC
From: hugh at davenport dot net dot nz Assigned: pierrick (profile)
Status: Closed Package: cURL related
PHP Version: 5.4.9 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: hugh at davenport dot net dot nz
New email:
PHP Version: OS:

 

 [2012-12-18 21:35 UTC] hugh at davenport dot net dot nz
Description:
------------
echo -e '<?php\n$ch=curl_init("http://localhost");curl_setopt($ch, CURLOPT_MUTE, 
true);\n?>' | php
PHP Notice:  Use of undefined constant CURLOPT_MUTE - assumed 'CURLOPT_MUTE' in - 
on line 2
PHP Warning:  curl_setopt() expects parameter 2 to be long, string given in - on 
line 2

Test script:
---------------
echo -e '<?php\n$ch=curl_init("http://localhost");curl_setopt($ch, CURLOPT_MUTE, true);\n?>' | php
PHP Notice:  Use of undefined constant CURLOPT_MUTE - assumed 'CURLOPT_MUTE' in - on line 2
PHP Warning:  curl_setopt() expects parameter 2 to be long, string given in - on line 2

Expected result:
----------------
CURLOPT_MUTE is defined, and setting that option mutes cURL

Actual result:
--------------
undefined constant, setopt fails

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-12-18 21:40 UTC] hugh at davenport dot net dot nz
Oh, the version is from debian testing
PHP 5.4.4-10 (cli) (built: Nov 24 2012 11:21:26)
 [2012-12-18 21:50 UTC] hugh at davenport dot net dot nz
-Type: Bug +Type: Documentation Problem
 [2012-12-18 21:50 UTC] hugh at davenport dot net dot nz
Seems that the option was deprecated in libcurl 7.8 and removed in 7.15.5, so 
this is a documentation issue

http://curl.haxx.se/libcurl/c/symbols-in-versions.html
 [2012-12-18 21:56 UTC] superspring at gmail dot com
Instead of using CURLOPT_MUTE you can use CURLOPT_RETURNTRANSFER to produce a similar output. Both of these suppress the output of the command.
 [2012-12-18 22:19 UTC] pierrick@php.net
Automatic comment from SVN on behalf of pierrick
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=328838
Log: Document bug #63800

CURLOPT_MUTE was removed in cURL 7.15.5
CURLOPT_RETURNTRANSFER can be use to get the same effect
 [2012-12-18 22:23 UTC] pierrick@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: pierrick
 [2012-12-18 22:23 UTC] pierrick@php.net
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.

Documentation was modified
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 17 23:01:32 2024 UTC