Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:54910 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 40210 invoked from network); 25 Aug 2011 01:51:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Aug 2011 01:51:16 -0000 Authentication-Results: pb1.pair.com smtp.mail=alan@akbkhome.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=alan@akbkhome.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain akbkhome.com designates 202.81.246.113 as permitted sender) X-PHP-List-Original-Sender: alan@akbkhome.com X-Host-Fingerprint: 202.81.246.113 246-113.netfront.net Received: from [202.81.246.113] ([202.81.246.113:56639] helo=246-113.netfront.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A0/A2-22164-29AA55E4 for ; Wed, 24 Aug 2011 21:51:15 -0400 Received: from akdesk ([192.168.0.40]) by akbkhome.com with esmtpa (Mailfort v1.2) (envelope-from ) id 1QwP62-0005C3-OZ; Thu, 25 Aug 2011 09:51:06 +0800 Message-ID: <4E55AA89.5050505@akbkhome.com> Date: Thu, 25 Aug 2011 09:51:05 +0800 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.18) Gecko/20110617 Thunderbird/3.1.11 MIME-Version: 1.0 To: Stas Malyshev CC: "internals@lists.php.net" References: <1314115682.2635.98.camel@guybrush> <4E545A6C.60704@akbkhome.com> <4E54C658.6070209@akbkhome.com> <887FE7CFF6F8DE4BB3A9535F53AFD06A495AAA2F@il-ex2.zend.net> <887FE7CFF6F8DE4BB3A9535F53AFD06A495AAE17@il-ex2.zend.net> <887FE7CFF6F8DE4BB3A9535F53AFD06A495AB00F@il-ex2.zend.net> <887FE7CFF6F8DE4BB3A9535F53AFD06A495AB153@il-ex2.zend.net> <4E54F0D6.9030005@akbkhome.com> <4E552E46.6070405@sugarcrm.com> <4E5562E1.3070005@lsces.co.uk> <4E556E47.3070301@sugarcrm.com> <4E558B62.1040607@akbkhome.com> <4E55A0F3.7090002@sugarcrm.com> In-Reply-To: <4E55A0F3.7090002@sugarcrm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-mailfort-sig: 85f52b1fb660e3cca5132468aedc9adc Subject: Re: [PHP-DEV] PHP 5.3.8 Released! From: alan@akbkhome.com ("alan@akbkhome.com") I'm not sure it's possible to get agreement on if this is a bug or not, you might see a bug, I just see this as a pointless change for consistency that pretty much nobody will ever need or use. I think I'll leave it as a) no bug was ever reported on the previous behaviour. b) intended "design" of is_subclass_of was originally to return false on non-object - andrei (1999) http://svn.php.net/viewvc/php/php-src/trunk/Zend/zend_builtin_functions.c?r1=17245&r2=17272 c) is_a() was introduced by sebastian (2002) and kept this intended behaviour http://svn.php.net/viewvc/php/php-src/trunk/Zend/zend_builtin_functions.c?r1=67102&r2=69234 d) when andrey (2004) proposed the change to accepts strings on is_subclass_of, he deliberately maintained the existing behaviour for is_a() http://svn.php.net/viewvc/php/php-src/trunk/Zend/zend_builtin_functions.c?r1=170604&r2=171349 e) is_a() has a valid use case , and is currently reasonably commonly used. d) the new behaviour is an uncommon use case, and can be done very easily in other ways. BTW. we could really do with a searchable archive of php.dev + internals... - It's pretty difficult to find out if this was ever discussed before.. Regards Alan On Thursday, August 25, 2011 09:10 AM, Stas Malyshev wrote: > Hi! > > On 8/24/11 4:38 PM, Alan Knowles wrote: >> Some real history for the young ones ;) > > I wonder who you are meaning... :) > >> So the previous behavior was very likely the 'designed' behavior. Not an >> accidental side effect, or bug. > > Bugs can be very well intentional, but if they use the language wrong > way they are bugs. > >> It's use case is reasonably common when doing tests on mixed returns >> (method returns PEAR:error, object or normal value.) > > That's when you use instanceof. > >> So we had a situation where a reasonable number of people (eg. anyone >> who had used PEAR), had seen and expected the previous behavior. > > Seeing wrong code somewhere doesn't mean it's not wrong. There's a > reason we have the manual. > >> Please do not fix something that is not broken, and breaks real working >> code, just for the hell of it, even in 5.4. > > is_a() was broken - it was returning different results from > essentially the same function is_subclass_of() for no reason at all > (no, somebody writing buggy code in PEAR using undocumented parameter > types is not a reason). The reason why we kept is_a() and not killed > it in favor of instanceof was to have it work with string arguments, > since instanceof does not. Thus, string arguments should be handled > properly. I can see how it can be argued that 5.3 is mature enough so > such changes shouldn't be there, however correct in theory. For 5.4, I > see no base for argument here.