Edit report at https://bugs.php.net/bug.php?id=28016&edit=1
ID: 28016 Updated by: der...@php.net Reported by: php at ter dot dk Summary: is_resource() returns false for resources of type "Unknown" -Status: Assigned +Status: Open Type: Feature/Change Request Package: *General Issues Operating System: * PHP Version: * -Assigned To: derick +Assigned To: Block user comment: N Private report: N 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] sni...@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] der...@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] der...@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