Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77587 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 76857 invoked from network); 24 Sep 2014 19:44:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Sep 2014 19:44:23 -0000 Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ajf.me designates 192.64.116.216 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 192.64.116.216 imap10-3.ox.privateemail.com Received: from [192.64.116.216] ([192.64.116.216:43429] helo=imap10-3.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D7/F2-57585-41F13245 for ; Wed, 24 Sep 2014 15:44:22 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id A87782400C3; Wed, 24 Sep 2014 15:44:17 -0400 (EDT) X-Virus-Scanned: Debian amavisd-new at imap10.ox.privateemail.com Received: from mail.privateemail.com ([127.0.0.1]) by localhost (imap10.ox.privateemail.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 8m-SiUX9z1JC; Wed, 24 Sep 2014 15:44:17 -0400 (EDT) Received: from oa-res-27-90.wireless.abdn.ac.uk (oa-res-27-90.wireless.abdn.ac.uk [137.50.27.90]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id 6C7292400C2; Wed, 24 Sep 2014 15:44:13 -0400 (EDT) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) In-Reply-To: <54231E06.90208@sugarcrm.com> Date: Wed, 24 Sep 2014 20:44:10 +0100 Cc: Pierre Joye , Michael Wallner , PHP internals , Florian Margaine Content-Transfer-Encoding: quoted-printable Message-ID: <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> To: Stas Malyshev X-Mailer: Apple Mail (2.1878.6) Subject: Re: [PHP-DEV] Invokation on __toString() for object used as array key From: ajf@ajf.me (Andrea Faulds) 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. >=20 > 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. >=20 > 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 = almost-useless, uninstantiatable class called Resource which any new = resource-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 = mostly fix it. Of course, gettype() is still going to return =93object=94 = not =93resource=94, but I suspect people are more likely to use = is_resource(). -- Andrea Faulds http://ajf.me/