Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77590 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 81897 invoked from network); 24 Sep 2014 19:59:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Sep 2014 19:59:46 -0000 Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 108.166.43.91 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 108.166.43.91 smtp91.ord1c.emailsrvr.com Linux 2.6 Received: from [108.166.43.91] ([108.166.43.91:49063] helo=smtp91.ord1c.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 53/14-57585-1B223245 for ; Wed, 24 Sep 2014 15:59:45 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp20.relay.ord1c.emailsrvr.com (SMTP Server) with ESMTP id 92344802D6; Wed, 24 Sep 2014 15:59:42 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp20.relay.ord1c.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id 12991802B9; Wed, 24 Sep 2014 15:59:41 -0400 (EDT) X-Sender-Id: smalyshev@sugarcrm.com Received: from Stass-MacBook-Pro.local ([UNAVAILABLE]. [74.85.23.222]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA) by 0.0.0.0:465 (trex/5.2.13); Wed, 24 Sep 2014 19:59:42 GMT Message-ID: <542322AE.4090208@sugarcrm.com> Date: Wed, 24 Sep 2014 12:59:42 -0700 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 MIME-Version: 1.0 To: Andrea Faulds CC: Pierre Joye , Michael Wallner , PHP internals , Florian Margaine 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> In-Reply-To: <9E9CD624-B581-417B-9C9D-5202CA84D52D@ajf.me> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] Invokation on __toString() for object used as array key From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > 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. This is a nice idea, but maybe interface would be even better? > Of course, 3rd-party extensions are still a problem, but this should > mostly fix it. Of course, gettype() is still going to return “object” > not “resource”, but I suspect people are more likely to use > is_resource(). yeah, I don't think I've seen many examples of something like checking gettype() of fopen() return. I've definitely seen checking it for is_resource. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/