[PATCH] interface_exists()
| From: | Andrey Hristov | Date: | Wed, 25 Aug 2004 00:09:09 +0000 |
| Subject: | [PATCH] interface_exists() | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-12337@lists.php.net to get a copy of this message | ||
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