Hi!

> I already figured out how to solve the `is_resource()` issue. Create
> an almost-useless, uninstantiatable class called Resource which any
> new resource-replacing classes inherit from. Then, make
> `is_resource()` check whether something is an instance of that
> class.

This is a nice idea, but maybe interface would be even better?

> Of course, 3rd-party extensions are still a problem, but this should
> mostly fix it. Of course, gettype() is still going to return “object”
> not “resource”, but I suspect people are more likely to use
> is_resource().

yeah, I don't think I've seen many examples of something like checking
gettype() of fopen() return. I've definitely seen checking it for
is_resource.

-- 
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to