On 24 Sep 2014, at 20:39, Stas Malyshev <smalys...@sugarcrm.com> wrote:

>> I also wonder why we still need them. Doing what has been done with gmp
>> for all resources would be a good move for 7.
> 
> In general, I think we do not - IIRC everything resources do objects can
> do better now, and the problems that prevented one from using objects
> instead of resources are long gone.
> 
> However, is_resource() checks and lots of third-party extensions using
> resources may be a bit of a problem for eliminating them.

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.

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().

--
Andrea Faulds
http://ajf.me/





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

Reply via email to