ID:               26867
 User updated by:  jaba at inbox dot lv
 Reported By:      jaba at inbox dot lv
-Status:           Bogus
+Status:           Open
 Bug Type:         Class/Object related
 Operating System: Any
 PHP Version:      5.0.0b3 (beta3)
 New Comment:

If this behaviour of get_declared_classes() is considered ok, then what
about class_exists()? Then we need interface_exists(), don't we? And we
shoud have false returned  if class_exists() called for an interface!
Otherwise it turns out that word "class" is not used clearly: in
class_exists() it includes interfaces, but in get_declared_classes() -
no more!


Previous Comments:
------------------------------------------------------------------------

[2004-01-11 10:22:23] [EMAIL PROTECTED]

Use get_declared_interfaces()


------------------------------------------------------------------------

[2004-01-10 19:37:40] jaba at inbox dot lv

I mixed up expected with actual results.

------------------------------------------------------------------------

[2004-01-10 19:36:09] jaba at inbox dot lv

Description:
------------
At PHP5 we have a nice thing called interface. get_declared_classes()
returns an array of all - abstract and non-abstract classes, but the
array does not contain my interfaces. If interface is loaded by
__autoload just like classes, shouldn't it be loaded into classes
register too? Is there any way to check is it interface or what?

Reproduce code:
---------------
<?php

interface Dao {
function Open();
function Close();
}

echo "<p>class_exists('Dao') says that Dao ";
echo ( class_exists('Dao') ? 'is defined' : 'is not defined' );

$classes = get_declared_classes();
echo "<p>get_declared_classes() says that Dao ";
echo ( in_array('Dao',$classes) ? 'is defined' : 'is not defined' );

?>

Expected result:
----------------
class_exists('Dao') says that Dao is defined

get_declared_classes() says that Dao is not defined

Actual result:
--------------
class_exists('Dao') says that Dao is defined

get_declared_classes() says that Dao is defined


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=26867&edit=1

Reply via email to