Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:16707 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 8523 invoked by uid 1010); 15 Jun 2005 21:15:16 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 8507 invoked from network); 15 Jun 2005 21:15:16 -0000 Received: from unknown (HELO php.net) (127.0.0.1) by localhost with SMTP; 15 Jun 2005 21:15:16 -0000 X-Host-Fingerprint: 62.46.16.138 M213P010.dipool.highway.telekom.at Received: from ([62.46.16.138:12741] helo=localhost.localdomain) by pb1.pair.com (ecelerity 1.2 r(5656M)) with SMTP id CE/87-20931-36A90B24 for ; Wed, 15 Jun 2005 17:15:15 -0400 Message-ID: To: internals@lists.php.net Date: Wed, 15 Jun 2005 23:15:46 +0200 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2) Gecko/20040803 [http://iworks.at] X-Accept-Language: de, en-us, en MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 62.46.16.138 Subject: while we're at it (PHP-5.1 & instanceof) From: mike@php.net (Michael Wallner) 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