Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:104371 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 43282 invoked from network); 12 Feb 2019 19:58:40 -0000 Received: from unknown (HELO mout.gmx.net) (212.227.15.15) by pb1.pair.com with SMTP; 12 Feb 2019 19:58:40 -0000 Received: from [192.168.2.104] ([79.222.45.201]) by mail.gmx.com (mrgmx003 [212.227.17.190]) with ESMTPSA (Nemesis) id 0LmKag-1hS6f61tmE-00Zvhn; Tue, 12 Feb 2019 17:41:34 +0100 To: Rowan Collins , bishop@php.net Cc: Nikita Popov , PHP internals References: Message-ID: <9fa40fe9-9f00-4902-10c6-e4e75d523117@gmx.de> Date: Tue, 12 Feb 2019 17:41:35 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: de-DE Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:T/T3nI7eymXkY408VQux2bIeU41Er+BYOeHvU79hgmhPCBiesn7 HAuOGSAXYGAPuxfT5wUZPNlgX+3jr9MCKxkk9WSQUJPKZcprmzEeCGaMK1WZrTH/e5EOjeZ NszMX9YSyL7ZaKEGguzy02XjhqBFy5IoG+tRJRAkxjn2KgJeEntQ0gtk35Ia4UHUkObMR77 aqYh51MLgQ7YZ8hAGeynQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:/Ln0QdeePs8=:0xXlcawIQ2sU5LYnO7UVgs Ic8x64nVlif4Ndfjw2dFwBx9vfPC1lcGEquSH44mexxZhV9R3tM0HzXyjR2hPMkIssdVVb7Xj koDdGIAlG9kbyM0/MarMgRgQZK+WSXq4HuYq9VPNFc5NU3gcX31efvaQDg6eSZSxiPDTawTq5 95pH1Rr2lBfhJxxOTj5Gxbq+xKIOWh0EKVuv1Dmx83n4apz6I5mj39PZOkcTsUUrsqDR1ir8o HE5Z9Kq5k8NyBB7xtWlIX1B4V8n7syjvBrTvPYQBxAv9CoafqEeIpNIKmuH25HXnw9qt2d0/Z e+4Zb1GWaldTex1DS4CllvS5IwfcIUoVAy8qhJ+NsJ2xv0eGKgzxs85p90ziWgBI3FRSR5MIy yoMM7kHy1dfM42P5H9sHR8fTV+cjMSmrVpR1zBZ81EMudCjISrae8AHU3ZYjV/5mEckQSqoas L9uVFUMB/Io1IjdQMrPPL70YH0s/qofWzNDxO3uXyaL93KFujoWqOSNZ+Qzv83KPK9Vyw0Tlv XC7cfsdvUtFPVWs3DVnbjYet5onzciVagIRZY/MnhVkLvYIdHG/es27ZZhQMpvoTh16yrBLsb zqS8DeKCHNIUY5FV4GIFARLzQTn4Wn+oaroiSrKGURWPz3V4OEEOwBcAtuuZqYBMT3qdGUYss bKvSjnVi1EnI7ZSGFRumVGHvQcSz277aPO6sATqeZzRtKN/dhUdFEpEZFvTiq0B/N5kbSJPqA YjDPThiRwIgjTGbXapyT4gofuFDW2RJeawp+Umd6VVIVc8JX6kz1B0WtTKmJUsk+nOMZQcvyD ouiQWmfCgZp/b4DLrB4sa9BmCL6zYF4nGUQHULJH84AorWc26dCJ7gw8aZVkmffe3JOSGaOvB uN5kiaZ2tYW4q6KZlevhy+kr9fQ2f6B7iLBprCLyuqqj6FI/BVk9qdHjhRi/B125u+VZX23DZ O0nP8SLR91Q== Subject: Re: [PHP-DEV] Convert ext/xml to use an object instead of resource From: cmbecker69@gmx.de ("Christoph M. Becker") On 12.02.2019 at 17:04, 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. > > 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