php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54718 get_resource_type work not correct
Submitted: 2011-05-12 12:18 UTC Modified: 2011-05-21 02:24 UTC
From: aiive at list dot ru Assigned:
Status: Not a bug Package: Variables related
PHP Version: 5.2.17 OS: Debian
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: aiive at list dot ru
New email:
PHP Version: OS:

 

 [2011-05-12 12:18 UTC] aiive at list dot ru
Description:
------------
In documentation write 
"This function will return FALSE and generate an error if handle is not a 
resource."
But in test script get_resource_type return "Unknown" instead FALSE.

Test script:
---------------
mysql_free_result($res);
var_dump(is_resource($res));
var_dump(get_resource_type($res));



Expected result:
----------------
bool(true)
string(7) "Unknown"

or 

bool(false)
bool(false)

Actual result:
--------------
bool(false)
string(7) "Unknown"

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-05-21 02:24 UTC] felipe@php.net
-Status: Open +Status: Bogus
 [2011-05-21 02:24 UTC] felipe@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

The documentation says:
"If the given handle is a resource, this function will return a string representing its type. **If the type is not identified by this function, the return value will be the string Unknown.**
This function will return FALSE and generate an error if handle is not a resource."
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 15:01:29 2024 UTC