On Tue, Feb 12, 2019 at 11:04 AM Rowan Collins <rowan.coll...@gmail.com> 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. > Exactly. I hope we would adopt a long-vision, since migrating from resources to objects has been discussed as the desired future state of things. > 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. > I think gettype should return "resource" for BC, but get_resource_type would be free to add more context about the now-object nature.