Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:12337 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 96204 invoked by uid 1010); 24 Aug 2004 22:15:38 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 96017 invoked from network); 24 Aug 2004 22:15:36 -0000 Received: from unknown (HELO iko.gotobg.net) (80.168.8.116) by pb1.pair.com with SMTP; 24 Aug 2004 22:15:36 -0000 Received: from pd951994e.dip.t-dialin.net ([217.81.153.78] helo=[192.168.0.32]) by iko.gotobg.net with asmtp (Exim 4.41) id 1BzjZt-0005hh-0l for internals@lists.php.net; Wed, 25 Aug 2004 01:15:41 +0300 Message-ID: <412BD8A5.7080608@php.net> Date: Wed, 25 Aug 2004 00:09:09 +0000 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8a2) Gecko/20040627 X-Accept-Language: en-us, en MIME-Version: 1.0 To: internals@lists.php.net Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - iko.gotobg.net X-AntiAbuse: Original Domain - lists.php.net X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - php.net X-Source: X-Source-Args: X-Source-Dir: Subject: [PATCH] interface_exists() From: andrey@php.net (Andrey Hristov) Hi, today I saw a note left by a person in the documentation on php.net about the lack of function named interface_exists(). Currently there is class_exists() which returns true always when the name is a declared class or a known interface. However an interface is not a class, some will say that it is a pure abstract class - that's true but the name is different and we already have abstract classes. In addition classes and interfaces are differentiated by get_declared_classes() and get_declared_interfaces(). There is a small BC in the case since the patch also makes class_exists() to return false when the name is a name of a known interface. We are only 2 months from 5.0.0 and this fix inconsitency. The patch is agains 5.1.0-dev but can be easily used against 5.0.2-dev . I will be very happy if it will be accepted and someone with karma commits it. The patch is here : http://hristov.com/andrey/projects/php_stuff/patches/interface_exists.patch.txt Thanks, Andrey