Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:46473 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 93547 invoked from network); 19 Dec 2009 01:41:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Dec 2009 01:41:49 -0000 Authentication-Results: pb1.pair.com header.from=jille@hexon.cx; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=jille@hexon.cx; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain hexon.cx from 85.223.64.56 cause and error) X-PHP-List-Original-Sender: jille@hexon.cx X-Host-Fingerprint: 85.223.64.56 56-64-223.ftth.xms.internl.net Received: from [85.223.64.56] ([85.223.64.56:46534] helo=istud.quis.cx) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EC/24-63064-A5F2C2B4 for ; Fri, 18 Dec 2009 20:41:48 -0500 Received: from [192.168.0.4] (unknown [192.168.0.4]) by istud.quis.cx (Postfix) with ESMTP id 56BD26109B8; Sat, 19 Dec 2009 02:41:44 +0100 (CET) Message-ID: <4B2C2F55.7020508@hexon.cx> Date: Sat, 19 Dec 2009 02:41:41 +0100 User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: =?UTF-8?B?Sm9oYW5uZXMgU2NobMO8dGVy?= CC: internals@lists.php.net References: <83.E2.63064.C512C2B4@pb1.pair.com> <1261183971.2756.1171.camel@guybrush> In-Reply-To: <1261183971.2756.1171.camel@guybrush> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] is_a() versus instanceof From: jille@hexon.cx (Jille Timmermans) Johannes Schlüter schreef: > On Sat, 2009-12-19 at 01:42 +0100, Johannes Mueller wrote: > >> if($foo instanceof bar){ >> .. >> } >> // runs without any notification >> > > instanceof is a language construct expecting a class identifier. > It doesn't complain about on-existing classes as it would need to > trigger the __autoloader which might be way too much. > Wouldn't it be an idea to make a setting for this ? I find it very annoying (however understandable) it doesn't complain if I make a typo.. I assume this works the same as try-catch(Exceptio $e); (note the missing 'n'); which got me fooled before. (To be sure to be understood: Create a setting which does check the class-existance; even when autoloading must be called for it) -- Jille