Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:46470 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 86228 invoked from network); 19 Dec 2009 00:42:05 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Dec 2009 00:42:05 -0000 X-Host-Fingerprint: 85.179.77.135 e179077135.adsl.alicedsl.de Received: from [85.179.77.135] ([85.179.77.135:22441] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 83/E2-63064-C512C2B4 for ; Fri, 18 Dec 2009 19:42:04 -0500 Message-ID: <83.E2.63064.C512C2B4@pb1.pair.com> To: internals@lists.php.net Date: Sat, 19 Dec 2009 01:42:00 +0100 Lines: 26 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5843 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-Posted-By: 85.179.77.135 Subject: is_a() versus instanceof From: johannes_m@gmx.net ("Johannes Mueller") Hi, is it intended to have different behaviours of is_a() and instanceof? Let's assume you have the following code snippets: class foo{} class baz{} //<-you have a typo here, want to write bar if($foo instanceof bar){ .. } // runs without any notification and if(is_a($foo, bar)){ .. } // runs with an undefined constant bar notification I think the instanceof solution can cause problems, because you can not trigger the problem. What do you think? Johannes