php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #80159 CURLOPT_PRIVATE does not accept array
Submitted: 2020-09-29 00:09 UTC Modified: 2020-09-29 00:26 UTC
From: divinity76 at gmail dot com Assigned:
Status: Not a bug Package: *Network Functions
PHP Version: 7.3.22 OS: Windows 10 x64 v1903
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: divinity76 at gmail dot com
New email:
PHP Version: OS:

 

 [2020-09-29 00:09 UTC] divinity76 at gmail dot com
Description:
------------
doing php -r 'curl_setopt(curl_init(),CURLOPT_PRIVATE,array());'

gives: PHP Notice:  Array to string conversion in Command line code on line 1

and for that matter, trying an object gives: PHP Recoverable fatal error:  Object of class stdClass could not be converted to string in Command line code on line 1

the documentation doesn't mention any restrictions on the value that goes into CURLOPT_PRIVATE, but testing suggest that it only accept strings,

either it's missing documentation (i'm guessing that's the case), or a bug is preventing anything except strings from being inserted.

Test script:
---------------
php -r 'curl_setopt(curl_init(),CURLOPT_PRIVATE,array());'


Actual result:
--------------
PHP Notice:  Array to string conversion in Command line code on line 1

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-09-29 00:26 UTC] danack@php.net
-Status: Open +Status: Not a bug
 [2020-09-29 00:26 UTC] danack@php.net
"the documentation doesn't mention any restrictions on the value that goes into CURLOPT_PRIVATE,"


https://www.php.net/manual/en/function.curl-setopt.php
"value should be a string for the following values of the option parameter: " which includes CURLOPT_PRIVATE.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 14 02:01:27 2024 UTC