Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:16713 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 74423 invoked by uid 1010); 15 Jun 2005 23:32:35 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 74408 invoked from network); 15 Jun 2005 23:32:35 -0000 Received: from unknown (HELO akbkhome.com) (127.0.0.1) by localhost with SMTP; 15 Jun 2005 23:32:35 -0000 X-Host-Fingerprint: 202.81.246.113 246-113.netfront.net Received: from ([202.81.246.113:38532] helo=akbkhome.com) by pb1.pair.com (ecelerity 1.2 r(5656M)) with SMTP id B2/1F-20931-19AB0B24 for ; Wed, 15 Jun 2005 19:32:34 -0400 Received: from [192.168.0.184] (helo=alanportable2.hklc.com) by akbkhome.com with esmtp (Exim 4.44) id 1DihVp-0005Pl-8x; Thu, 16 Jun 2005 07:41:38 +0800 To: Michael Wallner Cc: internals@lists.php.net In-Reply-To: References: Content-Type: text/plain Date: Thu, 16 Jun 2005 07:36:19 +0800 Message-ID: <1118878580.16156.4.camel@alanportable2.hklc.com> Mime-Version: 1.0 X-Mailer: Evolution 2.0.4 Content-Transfer-Encoding: 7bit X-ACL-Warn: "cleared badlog" Subject: Re: [PHP-DEV] while we're at it (PHP-5.1 & instanceof) From: alan@akbkhome.com (Alan Knowles) http://www.akbkhome.com/blog.php/View/75/removing+that+stupid+is_a +warning..html You're not the only one ;) Regards Alan On Wed, 2005-06-15 at 23:15 +0200, Michael Wallner wrote: > I already complained about that issue several times on IRC > and now that it's time for PHP-5.1 to come, I'll just throw > this question/rant in... > > Using is_a() throws a notice (E_STRICT IIRC) in PHP5, which > should be fine, because it was deprecated in favour of the > instanceof operator. But there's quite an ugly problem with > the instnceof operator - it needs the class to be checked > already loaded, while is_a() didn't -- *and* instanceof > let the script _die_ if there's no such class. > > To replace > is_a($obj, 'ClassName') > calls one would need to write > class_exists('ClassName') && ($obj instanceof ClassName) > > The point is, that I don't see the point why is_a() has been > deprecated (and replaced) by an operator that doesn't provide > the same functionality and can even be harmful (with fatal errors). > > Regards, > Mike >