Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:55625 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 80386 invoked from network); 25 Sep 2011 03:53:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Sep 2011 03:53:33 -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 67.192.241.203 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 67.192.241.203 smtp203.dfw.emailsrvr.com Linux 2.6 Received: from [67.192.241.203] ([67.192.241.203:41650] helo=smtp203.dfw.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E0/23-12016-BB5AE7E4 for ; Sat, 24 Sep 2011 23:53:32 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp10.relay.dfw1a.emailsrvr.com (SMTP Server) with ESMTP id 5E3A11B8163; Sat, 24 Sep 2011 23:53:28 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp10.relay.dfw1a.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id E6E431B80F0; Sat, 24 Sep 2011 23:53:27 -0400 (EDT) Message-ID: <4E7EA5B7.9010606@sugarcrm.com> Date: Sat, 24 Sep 2011 20:53:27 -0700 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:6.0.2) Gecko/20110902 Thunderbird/6.0.2 MIME-Version: 1.0 To: Alan Knowles CC: "internals@lists.php.net" References: <4E790B82.6090805@akbkhome.com> <8C.A0.17510.E4DE97E4@pb1.pair.com> <1316615094.2810.5.camel@guybrush> <1316629502-sup-831@fewbar.com> <20110922134956.GA28577@panix.com> <1316709104-sup-2744@fewbar.com> <1316713382.1290.60.camel@guybrush> <4E7BBA23.2080001@lerdorf.com> <4E7BC6BF.6080702@akbkhome.com> <4E7C5A24.8080305@lerdorf.com> <4E7E8B48.1060209@akbkhome.com> In-Reply-To: <4E7E8B48.1060209@akbkhome.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Backward Compatibility RFC - was Re: [PHP-DEV] Re: is_a() - again - a better fix From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! On 9/24/11 7:00 PM, Alan Knowles wrote: > Obviously I'd be keen to see this fix applied to 5.4 as the standard use > case for is_a() is mixed return testing as '$x instanceof "somestring"' > does not work. There is no reason to do $x instanceof "somestring" as you can do just $x instanceof Class. And for 99% of cases I've seen the second argument of is_a was constant - which means this code was plain wrong, there's no reason to use is_a in such case. In case you do have to use is_a - namely, when you have variable arguments - it would be rather strange if first argument wouldn't support string as class name, but the second one would, and moreover, is_subclass_of also would. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227