|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-08-05 07:54 UTC] jani@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 08:00:01 2025 UTC |
Description: ------------ In proper OOP, i should be able to define an interface, and have a class or abstract class implement it. If I create a class (or abstract class) which calls upon the interface in a method signature, everything is ok. However; if I extend the aforementioned class (or extend unto an abstract class), and I call upon the class which implements the interface, my compilation fails. Even if I provide a method in my interface and implement it in the class which uses the interface, it still fails. I have been able to reproduce this in both php 5.2.10 and 5.2.6 (personal and work servers, respectively) Reproduce code: --------------- interface Validatable {}; class Form implements Validatable { } abstract class Validator { abstract public function Validate( Validatable $v ); } abstract class Form_Validator extends Validator { public function Validate( Form $f ) { // do something in here... } } Expected result: ---------------- I should see nothing. OR -- if i look in memory, I should see that my Form_Validator has a Validate method in it. Actual result: -------------- Fatal error: Declaration of Form_Validator::Validate() must be compatible with that of Validator::Validate() in ....