From:
Operating system: Windows
PHP version: Irrelevant
Package: Class/Object related
Bug Type: Feature/Change Request
Bug description:interface/class
Description:
------------
A class that implements an interface should implement interface's methods,
but a method inside that class with type hint of class that implements the
interface would be accepted. Or not!?
After all, both are hierarchically identical.
Test script:
---------------
interface IEntity
{
public function equals(IEntity $other);
}
class Entity implements IEntity
{
public function equals(Entity $other)
{
return $this === $other;
}
}
Actual result:
--------------
Fatal error: Declaration of Entity::equals() must be compatible with that
of IEntity::equals() in C:\wamp\www\horusweb\models\Coded.class.php
--
Edit bug report at http://bugs.php.net/bug.php?id=52648&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=52648&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=52648&r=trysnapshot53
Try a snapshot (trunk):
http://bugs.php.net/fix.php?id=52648&r=trysnapshottrunk
Fixed in SVN:
http://bugs.php.net/fix.php?id=52648&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=52648&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=52648&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=52648&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=52648&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=52648&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=52648&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=52648&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=52648&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=52648&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=52648&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=52648&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=52648&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=52648&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=52648&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=52648&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=52648&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=52648&r=mysqlcfg