Req #28016 [Com]: is_resource() returns false for resources of type "Unknown"
| From: | justinasu at gmail dot com | Date: | Fri, 22 Aug 2014 12:09:25 +0000 |
| Subject: | Req #28016 [Com]: is_resource() returns false for resources of type "Unknown" | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-187236@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
Comment by: justinasu at gmail dot com
Reported by: php at ter dot dk
Summary: is_resource() returns false for resources of type
"Unknown"
Status: Open
Type: Feature/Change Request
Package: *General Issues
Operating System: *
PHP Version: *
Block user comment: N
Private report: N
New Comment:
this is still reproducible in PHP 5.4.30, how is this not fixed yet?
Previous Comments:
------------------------------------------------------------------------
[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
------------------------------------------------------------------------
[2004-04-16 03:15:17] derick@php.net
No, the fix was correct. Close() in this case destroyed the resource data in the variable, so
it's no longer a resource anymore. I think the correct thing to do here is to make gettype()
not show "resource" either.
------------------------------------------------------------------------
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