Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:53711 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 26113 invoked from network); 30 Jun 2011 22:48:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Jun 2011 22:48:55 -0000 Authentication-Results: pb1.pair.com smtp.mail=ralph@smashlabs.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=ralph@smashlabs.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain smashlabs.com from 67.15.58.61 cause and error) X-PHP-List-Original-Sender: ralph@smashlabs.com X-Host-Fingerprint: 67.15.58.61 openrce.org Linux 2.6 Received: from [67.15.58.61] ([67.15.58.61:35187] helo=users.smashlabs.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 33/93-04352-55DFC0E4 for ; Thu, 30 Jun 2011 18:48:54 -0400 Received: (qmail 11884 invoked from network); 30 Jun 2011 17:48:34 -0500 Received: from ip174-73-14-247.no.no.cox.net (HELO ralph-macbook.local) (174.73.14.247) by smashlabs.com with (AES256-SHA encrypted) SMTP; 30 Jun 2011 17:48:34 -0500 Message-ID: <4E0CFD51.6020203@smashlabs.com> Date: Thu, 30 Jun 2011 17:48:49 -0500 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.9) Gecko/20061207 Thunderbird/1.5.0.9 Mnenhy/0.7.4.666 MIME-Version: 1.0 To: internals@lists.php.net CC: Dmitry Stogov References: <4E0B7F82.5080006@smashlabs.com> <4E0C284B.1050601@zend.com> In-Reply-To: <4E0C284B.1050601@zend.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: Fix for #53727 (is_subclass_of resolution with interfaces) From: ralph@smashlabs.com (Ralph Schindler) 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 > >