Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:104367 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 23766 invoked from network); 12 Feb 2019 19:21:53 -0000 Received: from unknown (HELO mail-it1-f181.google.com) (209.85.166.181) by pb1.pair.com with SMTP; 12 Feb 2019 19:21:53 -0000 Received: by mail-it1-f181.google.com with SMTP id r11so8409024itc.2 for ; Tue, 12 Feb 2019 08:04:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=dilq95wC3H335zBZfx8F+EEhATKXcHI3N0NCsv+LpaE=; b=vTEqOQcAxtmlBSwEXQrloRuJedCl83FsKjDRK9yn5T9+539ZmMjSAebfDQSn3fLw0W u0EGBTxTpgC94KN/5Xym9fqjjm7XvIpcWpIq6HdpK7rAky6169ycMBC+tr60R5bJdS9S /5/yInRre7gMIvNXXdbvLd37AZbwF3deuLScw8JEl1Olwh+Px9UooViYf05T9vthcM+5 8RxkZijbv1BtUbF253viTTFicS9s2KUi+C4214ieBEugNjTAfc8Gltaan5+jjXCPBG7y oXUFPv9DFFYYwXTMGm9LlXpL8m4crTJ25nX8tNaceP6bF1T9ffiGq2nD/41JtgiwFnzt r2CA== 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:from:date :message-id:subject:to:cc; bh=dilq95wC3H335zBZfx8F+EEhATKXcHI3N0NCsv+LpaE=; b=D2+hDLPzmVzn9zJJfKr7IiDCA08rgbY28br8BTeIFBW8tkaHC6Oyak8CVeiYmxDEc9 6ksYINOXzNWsSJ+eTZaw0OR7VyLpIgwLUwEMZ9ndtspUVmULen8OMkoKWZACnAx0vgpu 0u6cP7PwzifmRdITIGt6ZhtRSfpiU0w9H2+H1/aFKdZ/OLduU1EqOWIx7FGnAw7rF8Lw CKdN3Ym3Qw6BBsxCruSSIOy5/a7z1ROAV9ZVkTvayoeV0DE6jvKfV4EXyOxMbv9F+Ao2 sclmanhjgucJy1Qf5rxAzuki/yAJQXNif6tx4zxMw/pkyLv/pxAVXkjQaUB7N9VnsBot HMBQ== X-Gm-Message-State: AHQUAubuAYalNm/fyRssg6yRca4uFq2bnxiYX5NyKmA+FXoNAwcbx+EG Uh4iUEmH2efKDeqxeDrk2ELj9SgQGdTBx4kD9v0= X-Google-Smtp-Source: AHgI3IYlGbFd3HJ89/tdXbsuEohALAMU8uixJTAOykumc+9VAmyt5T0BKF0VBRydMSS1RqLY0T8j84ynjEAlpGb6cfc= X-Received: by 2002:a6b:e514:: with SMTP id y20mr2153485ioc.235.1549987487484; Tue, 12 Feb 2019 08:04:47 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 12 Feb 2019 16:04:36 +0000 Message-ID: To: bishop@php.net Cc: Nikita Popov , PHP internals Content-Type: multipart/alternative; boundary="000000000000990e960581b495f3" Subject: Re: [PHP-DEV] Convert ext/xml to use an object instead of resource From: rowan.collins@gmail.com (Rowan Collins) --000000000000990e960581b495f3 Content-Type: text/plain; charset="UTF-8" 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. 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. Regards, -- Rowan Collins [IMSoP] --000000000000990e960581b495f3--