Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:21346 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 99403 invoked by uid 1010); 27 Dec 2005 14:45:20 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 99388 invoked from network); 27 Dec 2005 14:45:20 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Dec 2005 14:45:20 -0000 X-Host-Fingerprint: 81.169.182.136 ajaxatwork.net Linux 2.4/2.6 Received: from ([81.169.182.136:43777] helo=strato.aixcept.de) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 1E/B4-28258-F7351B34 for ; Tue, 27 Dec 2005 09:45:19 -0500 Received: from [192.168.1.3] (dslb-084-063-012-012.pools.arcor-ip.net [84.63.12.12]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by strato.aixcept.de (Postfix) with ESMTP id 91F2535C1E7; Tue, 27 Dec 2005 15:45:15 +0100 (CET) Date: Tue, 27 Dec 2005 15:45:32 +0100 Reply-To: Marcus Boerger X-Priority: 3 (Normal) Message-ID: <910693043.20051227154532@marcus-boerger.de> To: Jochem Maas Cc: php internals In-Reply-To: <43B15018.8070501@iamjochem.com> References: <43B15018.8070501@iamjochem.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] $x instanceof __CLASS__ From: helly@php.net (Marcus Boerger) Hello Jochem, right now it's by design, instanceof takes a T_STRING or a variable. __CLASS__ returns a const string which is different form a T_STRING. marcus Tuesday, December 27, 2005, 3:30:48 PM, you wrote: > hi there, > a quick question regarding whether the following is by design, > because it causes a parse error (the code I tried out did occur within > a class definition ! :-): > if (!$field instanceof __CLASS__) { > // do something > } > where as this obviously does work: > $class = __CLASS__; > if (!$field instanceof $class) { > // do something > } > as does this: > if (!$field instanceof self) { > // do something > } > rgds, > jochem Best regards, Marcus