Re: is_a fix for 5.4 and HEAD

From: Date: Fri, 14 Oct 2011 00:06:31 +0000
Subject: Re: is_a fix for 5.4 and HEAD
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-55801@lists.php.net to get a copy of this message
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. 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? -Rasmus

« previous php.internals (#55801) next »