php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #80491 [ES] curl_init() returns object instead of resource
Submitted: 2020-12-07 14:12 UTC Modified: 2021-02-03 18:18 UTC
From: ricardo at banak dot com Assigned: julionc (profile)
Status: Closed Package: Translation problem
PHP Version: 8.0.0 OS: Centos 7.9.2009
Private report: No CVE-ID: None
 [2020-12-07 14:12 UTC] ricardo at banak dot com
Description:
------------
Documentation states curl_init() as:

curl_init ([ string $url = NULL ] ) : resource

but the result is an object, not a resource.

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

if (is_object($ch)) {
    echo '$ch is an object';
} 

if (is_resource($ch)) {
    echo '$ch is a resource';
} 




Expected result:
----------------
Expected:
$ch is a resource

Currently:
$ch is an object


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-12-07 14:16 UTC] cmb@php.net
-Type: Bug +Type: Documentation Problem
 [2020-12-07 14:19 UTC] kocsismate@php.net
-Status: Open +Status: Not a bug
 [2020-12-07 14:19 UTC] kocsismate@php.net
It is the result of an intentional change: https://php.watch/versions/8.0/resource-CurlHandle (but I could have linked the related upgrading note).

Please note that PHP 8.0 migrated quite a few other resources to objects as well. You can refer to the documentation or https://github.com/php/php-tasks/issues/6 for more information.
 [2020-12-07 14:24 UTC] ricardo at banak dot com
Sorry, my bad.
Therefore is a documentation issue.

Thank you both.
 [2020-12-07 14:24 UTC] cmb@php.net
-Status: Not a bug +Status: Feedback -Package: cURL related +Package: Translation problem -Assigned To: +Assigned To: cmb
 [2020-12-07 14:24 UTC] cmb@php.net
Well, EN docs have already been updated, so this is likely about a
translation.  Which one?
 [2020-12-07 14:52 UTC] ricardo at banak dot com
-Status: Feedback +Status: Assigned
 [2020-12-07 14:52 UTC] ricardo at banak dot com
That's correct.
Spanish here.
 [2020-12-07 15:01 UTC] cmb@php.net
-Summary: curl_init() returns object instead of resource +Summary: [ES] curl_init() returns object instead of resource
 [2020-12-07 15:01 UTC] cmb@php.net
Thanks for the swift reply.
 [2020-12-07 15:05 UTC] cmb@php.net
-Assigned To: cmb +Assigned To:
 [2021-02-03 18:18 UTC] julionc@php.net
-Assigned To: +Assigned To: julionc
 [2021-02-03 18:29 UTC] julionc@php.net
Automatic comment on behalf of julionc
Revision: http://git.php.net/?p=doc/es.git;a=commit;h=9d3a231289c1e2761e10771f1ef6075ed17e76b7
Log: Fix #80491: [ES] curl_init() returns object instead of resource
 [2021-02-03 18:29 UTC] julionc@php.net
-Status: Assigned +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 02:01:28 2024 UTC