Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:104368 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 28673 invoked from network); 12 Feb 2019 19:30:04 -0000 Received: from unknown (HELO mail-vs1-f68.google.com) (209.85.217.68) by pb1.pair.com with SMTP; 12 Feb 2019 19:30:04 -0000 Received: by mail-vs1-f68.google.com with SMTP id t13so1916029vsk.3 for ; Tue, 12 Feb 2019 08:13:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=tI1btDRw/BM5Ww6YkVOPN5f3XyamIWzYL+3NAtoFjfc=; b=R5185hsn82B8mb6ju/Pr6Geb+NNXOHBCWJl7L2OQWM+m2mzOFbLNC9Tez3MYbaxtke Xmocuz/9kdlYRR5Cc5lJx/lgosZcdBmKMKIAMlOTN7a/sH5qvT2R+Wk+AOEIy0LFG1Zl jjeZcbIX7psdYhff2iFCuoum/2ILAD5+OMvGB53vGlbtFKCke/gbkrZzh+qwNqInHBvl aemWutWgiq3A6dSzJwqtuFGJM80yZGHMr2G4ayGdh3MaiKJqVtrJECG1UnrkJAp1DzCo YR+mkayVvZ4qa+gTSzcFsHSajYAdHS6ieIfrBf99FLWBSFiBHWAMuR9prW/FXEgJIWAF CleA== X-Gm-Message-State: AHQUAuYC6AdPVLT5Ubng90FLYGeUUmSA758Jk3D3iuMAPsAdcVSkqbay Ohnm8bKy3i1CsrH+aBjq8mJW68PCkQgKVv7tN3g= X-Google-Smtp-Source: AHgI3IYuM2NjXkmHtP5pjJXdilLOqyu3/WcdVu9kVRlW3urhQ5lK1i6bsd23RvhyG3WjUlXmAIiPHpqaCthMcQSM3bA= X-Received: by 2002:a67:6d42:: with SMTP id i63mr1907257vsc.158.1549987978301; Tue, 12 Feb 2019 08:12:58 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Reply-To: bishop@php.net Date: Tue, 12 Feb 2019 11:12:31 -0500 Message-ID: To: Rowan Collins Cc: Nikita Popov , PHP internals Content-Type: multipart/alternative; boundary="000000000000da58020581b4b28b" Subject: Re: [PHP-DEV] Convert ext/xml to use an object instead of resource From: bishop@php.net (Bishop Bettini) --000000000000da58020581b4b28b Content-Type: text/plain; charset="UTF-8" On Tue, Feb 12, 2019 at 11:04 AM Rowan Collins wrote: > On Tue, 12 Feb 2019 at 15:30, Bishop Bettini 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. --000000000000da58020581b4b28b--