On 12.02.2019 at 17:04, Rowan Collins wrote: > On Tue, 12 Feb 2019 at 15:30, Bishop Bettini <bis...@php.net> wrote: > >> +1 for movement away from resources, generally. >> >> Resources represent connections to external resources, in a manner that's >> opaque to userland [1]. Would it make sense to update is_resource (and >> friends) to be aware that "resources" returned from xml_parser_* are not >> resources proper, but rather resources nominal? > > While such a feature would have limited use in this case, as Johannes > points out, it might be a nice general pattern to establish for migrating > other resources in future. All such objects could implement an empty > "Resource" interface, which couldn't be implemented directly from userland, > and just triggered this magic behaviour. > > There would still be other BC impacts, though; for instance, gettype() > would return "object" instead of "resource", unless we overloaded that > based on the interface as well, which might be a bit confusing.
And we must not forget that resource to int conversion is clearly defined, while object to int conversion is not. -- Christoph M. Becker -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php