From: jami dot pekkanen at ateco dot fi
Operating system: Linux
PHP version: 5.0.4
PHP Bug Type: Class/Object related
Bug description: Abstract methods in interfaces break class-relations
Description:
------------
If interface contains abstract method, direct implementor isn't reported
as subclass of the interface. However, if one has abstract class in the
inheritance hierarchy, implementing classes are reported as subclasses of
the interface.
Should abstract methods in interfaces even exist?
Reproduce code:
---------------
<?php
interface SomeInterface
{
abstract public function Foo();
}
class BrokenImplementor implements SomeInterface
{
public function Foo() {}
}
abstract class DummyParent implements SomeInterface {}
class WorkingImplementor extends DummyParent
{
public function Foo() {}
}
var_dump(is_subclass_of('WorkingImplementor', 'SomeInterface'));
var_dump(is_subclass_of('BrokenImplementor', 'SomeInterface'));
?>
Expected result:
----------------
bool(true)
bool(true)
Actual result:
--------------
bool(true)
bool(false)
--
Edit bug report at http://bugs.php.net/?id=34157&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34157&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=34157&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=34157&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=34157&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=34157&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=34157&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=34157&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=34157&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=34157&r=support
Expected behavior: http://bugs.php.net/fix.php?id=34157&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=34157&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=34157&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=34157&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34157&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=34157&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=34157&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=34157&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=34157&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=34157&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=34157&r=mysqlcfg