Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:53683 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 95159 invoked from network); 29 Jun 2011 21:13:04 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Jun 2011 21:13:04 -0000 Authentication-Results: pb1.pair.com header.from=ircmaxell@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ircmaxell@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.83.170 as permitted sender) X-PHP-List-Original-Sender: ircmaxell@gmail.com X-Host-Fingerprint: 74.125.83.170 mail-pv0-f170.google.com Received: from [74.125.83.170] ([74.125.83.170:36354] helo=mail-pv0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 45/B3-10518-E559B0E4 for ; Wed, 29 Jun 2011 17:13:02 -0400 Received: by pvh10 with SMTP id 10so1196577pvh.29 for ; Wed, 29 Jun 2011 14:12:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=zmGfJuq564LmB6M+uz6x0+cR0p3i0Lwiy2TrpY2T7nk=; b=nWeOOCNiZfgMaUenDcHyiR+7kr8WfDlrnjolHsqFgDGd0ykd3inAfAtSmNok/tlcD1 6KeU+clg1if7oHiymcDZueqc9Jf+J9eJOMmYcOdAmUTGscMwTLYEoMs03WmHI8IQMgKO gtDqq+Uq5pLXm973glxzsP6//3CCrP7ipGmnY= MIME-Version: 1.0 Received: by 10.68.27.69 with SMTP id r5mr1485557pbg.382.1309381979575; Wed, 29 Jun 2011 14:12:59 -0700 (PDT) Received: by 10.68.56.104 with HTTP; Wed, 29 Jun 2011 14:12:59 -0700 (PDT) In-Reply-To: References: <4E0B7F82.5080006@smashlabs.com> <2297BE5C-4B5F-4C16-9624-4137B63329FD@bitextender.com> <4E0B81D4.3080205@smashlabs.com> <2A11AEAB-C62D-4FAB-86BF-A6651B40DC10@bitextender.com> Date: Wed, 29 Jun 2011 17:12:59 -0400 Message-ID: To: Martin Scotta Cc: Paul Dragoonis , =?ISO-8859-1?Q?David_Z=FClke?= , Ralph Schindler , internals , Dmitry Stogov Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Fix for #53727 (is_subclass_of resolution with interfaces) From: ircmaxell@gmail.com (Anthony Ferrara) > are you kidding, right? var_dump('Foo' instanceof 'Bar'); //Fatal Error: instanceof expects an object instance, constant given On Wed, Jun 29, 2011 at 5:05 PM, Martin Scotta wro= te: > On Wed, Jun 29, 2011 at 5:25 PM, Paul Dragoonis wro= te: > >> On Wed, Jun 29, 2011 at 9:22 PM, David Z=FClke >> wrote: >> > On 29.06.2011, at 22:20, Paul Dragoonis wrote: >> > >> >> On Wed, Jun 29, 2011 at 8:49 PM, Ralph Schindler >> wrote: >> >>> Correct. >> >>> >> >>> I was hasty in that example, the first was copied & tested (and is >> reflected >> >>> in the test, as is that variation of what I wrote up.) >> >>> >> >>> Either way, test and patch work in 5_3. >> >> >> >> Doesn't this functionality confuse matters? >> >> >> >> If this patch is added, is there now no difference between instanceof >> >> and is_subclass_of(). If this is the case my question is then why do >> >> we have two methods to do the same thing? >> >> >> >> I thought instanceof was for parent classes + interfaces.. and >> >> is_subclass_of() was just for parent classes. >> > >> > instanceof is a language construct and only operates on object instanc= es. >> > >> >> I didn't spot you could pass a string into is_subclass_of() I thought >> it was only objects. With that in mind it would be good to have >> subclass_of() include interfaces. >> >> > are you kidding, right? > > $class =3D 'stdClass'; > $instance =3D new $class; > var_dump( $instance instanceof $class ); > > > >> >> > David >> > >> > >> > >> >> -- >> PHP Internals - PHP Runtime Development Mailing List >> To unsubscribe, visit: http://www.php.net/unsub.php >> >> >