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


--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to