Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77618 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 52899 invoked from network); 25 Sep 2014 09:50:31 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Sep 2014 09:50:31 -0000 Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.53 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.192.53 mail-qg0-f53.google.com Received: from [209.85.192.53] ([209.85.192.53:57346] helo=mail-qg0-f53.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BF/E0-45824-665E3245 for ; Thu, 25 Sep 2014 05:50:31 -0400 Received: by mail-qg0-f53.google.com with SMTP id e89so6851477qgf.12 for ; Thu, 25 Sep 2014 02:50:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=SXhQymG+cfnEnP02cdzHIFx5hTu7cJoVysnPfXFj184=; b=1EUrP6UhqefNLBTNeqU/5cbIwiJi6sbzdtuj5JWUpA2ENppnNwIjN1g9ncpiQAodz9 LS0dgbgxvA3q13QXHbGrtLFjRbcQo268He+GJsGvR9ZzHCPccaZSIasd78pAirMprL4b FwbqbcOq27Wa6sA0pAnnNZYd5VNkkiXal3NDfa0nNKNSCNmO7L59KCyKWM3Y7cs9VEhj txTyqDTwQvgHywXqiTn3xhdMddMv8lUbe1aZHQggMgf3I1UbYyMoCtNw0r+FVJlEtoMJ ZJYaf3bAqAthVf496rg0VKxbO25cUf2Wk/z23iq5Qxx+f2GW/gwfYHajVNt/cG6ETzdm Arvw== MIME-Version: 1.0 X-Received: by 10.140.49.71 with SMTP id p65mr18736288qga.54.1411638628201; Thu, 25 Sep 2014 02:50:28 -0700 (PDT) Received: by 10.140.22.51 with HTTP; Thu, 25 Sep 2014 02:50:28 -0700 (PDT) In-Reply-To: <9E9CD624-B581-417B-9C9D-5202CA84D52D@ajf.me> References: <54213481.8080700@php.net> <54213ECC.5080204@php.net> <54214E57.3080200@php.net> <54220B80.5050208@sugarcrm.com> <54225D5B.3030402@php.net> <54226509.8080405@sugarcrm.com> <54227E98.3050402@php.net> <54231E06.90208@sugarcrm.com> <9E9CD624-B581-417B-9C9D-5202CA84D52D@ajf.me> Date: Thu, 25 Sep 2014 11:50:28 +0200 Message-ID: To: Andrea Faulds Cc: Stas Malyshev , Michael Wallner , PHP internals , Florian Margaine Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Invokation on __toString() for object used as array key From: pierre.php@gmail.com (Pierre Joye) On Wed, Sep 24, 2014 at 9:44 PM, Andrea Faulds wrote: > > On 24 Sep 2014, at 20:39, Stas Malyshev wrote: > >>> I also wonder why we still need them. Doing what has been done with gmp >>> for all resources would be a good move for 7. >> >> In general, I think we do not - IIRC everything resources do objects can >> do better now, and the problems that prevented one from using objects >> instead of resources are long gone. >> >> However, is_resource() checks and lots of third-party extensions using >> resources may be a bit of a problem for eliminating them. > > I already figured out how to solve the `is_resource()` issue. Create an a= lmost-useless, uninstantiatable class called Resource which any new resourc= e-replacing classes inherit from. Then, make `is_resource()` check whether = something is an instance of that class. > > Of course, 3rd-party extensions are still a problem, but this should most= ly fix it. Of course, gettype() is still going to return =E2=80=9Cobject=E2= =80=9D not =E2=80=9Cresource=E2=80=9D, but I suspect people are more likely= to use is_resource(). Is it really necessary? I could imagine a transition with 5.7 for that, similar to gmp. Cheers, --=20 Pierre @pierrejoye | http://www.libgd.org