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
Applying right now. Thanks.
Andi
At 12:09 AM 8/25/2004 +0000, Andrey Hristov wrote:
Hi,
today I saw a note left by a person in the documentation on php.net
about the lack of function namedinterface_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 byget_declared_classes()
andget_declared_interfaces()
.
There is a small BC in the case since the patch also makesclass_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.txtThanks,
Andrey