Req #28016 [Opn->Csd]: is_resource() returns false for resources of type "Unknown"
| From: | cmb@php.net | Date: | Thu, 29 Sep 2016 11:50:41 +0000 |
| Subject: | Req #28016 [Opn->Csd]: is_resource() returns false for resources of type "Unknown" | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-204338@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=28016&edit=1
ID: 28016
Updated by: cmb@php.net
Reported by: php at ter dot dk
Summary: is_resource() returns false for resources of type
"Unknown"
-Status: Open
+Status: Closed
Type: Feature/Change Request
Package: *General Issues
Operating System: *
PHP Version: *
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
> In other words, it's the inconsistency between is_resource() and
> gettype() I see as the bug.
And this inconsistency has been resolved long ago, see
<https://3v4l.org/qnk41>, so this ticket can be closed.
Previous Comments:
------------------------------------------------------------------------
[2014-08-22 12:09:24] justinasu at gmail dot com
this is still reproducible in PHP 5.4.30, how is this not fixed yet?
------------------------------------------------------------------------
[2004-07-19 19:16:39] php at afdelingp dot dk
I have created a patch for Piotr Pawlow's version of php_imlib 0.3, fixing this issue for imlib
(though I think the PHP behavior is strange at best).
http://www.afdelingp.dk/files/php-4.3.8-imlib-rsrc.diff
Best regards,
Morten K. Poulsen
------------------------------------------------------------------------
[2004-04-16 15:11:33] sniper@php.net
Derick: I agree, just change gettype() too.
And imlib / other extensions using the wrong way in registering resources should be fixed. The
'non-named' resource is meant for something else..
------------------------------------------------------------------------
[2004-04-16 11:05:22] derick@php.net
If the imlib extension gives it a proper name then it should work fine, so I think it's also a
bug there.
------------------------------------------------------------------------
[2004-04-16 08:37:21] php at ter dot dk
But will it solve the problem in my situation? After all, I do have a resource by hand, and would be
pretty sad if other functions wouldn't recognize it as a resource.
I do agree though that making gettype not return "resource" for a closed resource (since
is_resource() already does that). I just don't like the idea that these functions might not
recognize my resource at all.
- Peter Brodersen
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=28016
--
Edit this bug report at https://bugs.php.net/bug.php?id=28016&edit=1