Bug->Doc #80491 [Opn]: curl_init() returns object instead of resource

From: Date: Mon, 07 Dec 2020 14:16:53 +0000
Subject: Bug->Doc #80491 [Opn]: curl_init() returns object instead of resource
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-18205@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=80491&edit=1

 ID:                 80491
 Updated by:         cmb@php.net
 Reported by:        ricardo at banak dot com
 Summary:            curl_init() returns object instead of resource
 Status:             Open
-Type:               Bug
+Type:               Documentation Problem
 Package:            cURL related
 Operating System:   Centos 7.9.2009
 PHP Version:        8.0.0
 Block user comment: N
 Private report:     N

 New Comment:

That is a deliberate change[1].

[1] <https://www.php.net/manual/en/migration80.incompatible.php#migration80.incompatible.resource2object>


Previous Comments:
------------------------------------------------------------------------
[2020-12-07 14:12:01] 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



------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=80491&edit=1


Thread (7 messages)

« previous php.doc.bugs (#18205) next »