Re: Re: Fix for #53727 (is_subclass_of resolution with interfaces)

From: Date: Mon, 04 Jul 2011 14:59:05 +0000
Subject: Re: Re: Fix for #53727 (is_subclass_of resolution with interfaces)
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-53741@lists.php.net to get a copy of this message
Hi Ralph, Your patch was absolutely correct. I've committed it with small improvements. Thanks. Dmitry. On 07/01/2011 02:48 AM, Ralph Schindler wrote:
Hey Dmitry, is_a_impl() is an implementation that is shared by is_a() and is_subclass_of() calls. There is a flag called only_subclass that allows there to be switching behavior in is_a_impl(). The issue has been updated with a new patch that now takes objects into account. It also has a comment in there that better explains what the patch is doing. I cannot assign it to you as I am not the original reporter, nor have access, can you assign it to yourself? Thanks, Ralph On 6/30/11 2:39 AM, Dmitry Stogov wrote:
Hi Ralph, I agree with expected behavior, but didn't understand the patch and which side effects it may have as well as the original implementation of is_a_impl(). It looks for me like one huge bug :) Please reassign the bug to me, if you like me to take a deeper look. I can do it only on next week. Thanks. Dmitry. On 06/29/2011 11:39 PM, Ralph Schindler wrote:
Hi all, Concerning: https://bugs.php.net/bug.php?id=53727 I had put together a quick patch against PHP_5_3 to fix, for what I and others might consider, an issue with is_subclass_of() returning false in this situation: interface A {} class B implements A {} var_dump(is_subclass_of('B', 'A')); // false, should be true It returns false in situations where a class does not have a parent. If a parent currently exists, the above works fine. For example: interface A {} class B implements A {} class C extends B {} var_dump(is_subclass_of('B', 'A')); // true Attached is a patch against PHP_5_3, I can create a patch against PHP_5_4 if need be. I've added a test file and all the current Zend/tests run as expected. Thanks, Ralph


« previous php.internals (#53741) next »