Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:55802 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 66662 invoked from network); 14 Oct 2011 02:13:27 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Oct 2011 02:13:27 -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:36691] helo=246-113.netfront.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DE/32-49888-5CA979E4 for ; Thu, 13 Oct 2011 22:13:26 -0400 Received: from 154.126.198.203.static.netvigator.com ([203.198.126.154] helo=[192.168.1.10]) by akbkhome.com with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Mailfort v1.2) (envelope-from ) id 1REXGr-0005Mj-1S; Fri, 14 Oct 2011 10:13:16 +0800 Message-ID: <4E979AA4.6060001@akbkhome.com> Date: Fri, 14 Oct 2011 10:12:52 +0800 User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.21) Gecko/20110831 Icedove/3.1.13 MIME-Version: 1.0 To: Rasmus Lerdorf CC: internals@lists.php.net References: <4E969596.4090704@akbkhome.com> <4E970257.2010906@sugarcrm.com> <4E977A4B.4020609@akbkhome.com> <4E977D07.4010503@lerdorf.com> In-Reply-To: <4E977D07.4010503@lerdorf.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-mailfort-sig: 51bc716e0ed52d1046bbcb68d8269112 Subject: Re: [PHP-DEV] is_a fix for 5.4 and HEAD From: alan@akbkhome.com (Alan Knowles) On Friday, October 14, 2011 08:06 AM, Rasmus Lerdorf wrote: > On 10/13/2011 04:54 PM, Alan Knowles wrote: >> On Thursday, October 13, 2011 11:23 PM, Stas Malyshev wrote: >>> On 10/13/11 12:39 AM, Alan Knowles wrote: >>>> Can someone apply this to HEAD and PHP_5_4, or let me have karma. >>>> >>>> https://bugs.php.net/patch-display.php?bug_id=55475&patch=final_patch_for_5_4_and_HEAD&revision=latest >>>> >>>> >>>> Thanks >>>> Alan >>>> >>>> >>> +/* {{{ proto bool is_subclass_of(mixed object_or_string, string >>> class_name [, bool allow_string=true]) >>> +/* {{{ proto bool is_a(mixed object_or_string, string class_name [, >>> bool allow_string=false]) >>> >>> This is quite strange - two almost identical functions with completely >>> different default semantics. >> Yes, and if you can think of a way to depreciate them now so that it >> does not break BC and could be changed later, please feel free, but I've >> looked at it quite a bit and could not find any other way. > Argh! Pet-peeve, it's deprecate. Depreciate means something completely > different. Agh to much accounting recently ;) > I agree that it is slightly messy, but we have painted ourselves into a > bit of a corner with the 5.3 mess. Stas, the whole point here is that > changing the is_a() default in 5.3 caused huge problems, including > security ones, so setting allow_string to false by default fixes that BC > break in 5.3. Considering the huge amount of code hit by this I think we > should keep that default in 5.4. > > Alan, does is_subclass_of() actually need the allow_string flag at all? > It has always been documented take a mixed and hit the autoloader, so > why would we need an option to disable the string? I don't think I've used is_subclass_of for years, the flag is a knock on effect from sharing the same code, and may be useful in some edge cases (if somebody wanted to use subclass_of with user input.. ), since that bit does not affect me, I do not mind either way. To disable for subclass of it is quite trivial, I can get a full patch ready (including updated tests) if we go that way. if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, only_subclass ? "zs" : "zs|b", &obj, &class_name, &class_name_len, &allow_string) == FAILURE) { Regards Alan > -Rasmus >