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

 ID:               48984
 Comment by:       giorgio dot liscio at email dot it
 Reported by:      themastersleader at hotmail dot com
 Summary:          Strict errors when implementing an interface (with
                   private methods)
 Status:           Bogus
 Type:             Bug
 Package:          Class/Object related
 Operating System: Win XP
 PHP Version:      5.3.0

 New Comment:

this is not a bug



extending a method means that in the sub-class the overrided method can
be used as can i use it in the parent class



so



if i have



function test($a, $b, $c){}



in the subclasses every additional parameter must be "not required" to
make the method working



function test($a, $b, $c, $d=NULL, $e=NULL, $f=NULL)



=NULL means that are not required





so in your code



class ChildClass extends ParentClass

{

        public function foo(array $content=NULL) { }

}


Previous Comments:
------------------------------------------------------------------------
[2010-07-14 20:18:10] itay dot malimovka at gmail dot com

I am having a similar issue in php 5.3 with two classes inheriting from
each other. Both have same name methods with different params. Both
methods are private. I get the same error.

This is NOT a normal behaviour!

------------------------------------------------------------------------
[2009-07-22 15:34:12] themastersleader at hotmail dot com

I think it is a bug, someone else tested it in php 5.2.9 and then it
worked, 5.3.0 gives problems.



Greets)

------------------------------------------------------------------------
[2009-07-21 11:39:06] themastersleader at hotmail dot com

Can someone explain why it isn't a bug?

How to work arround this?

Don't use interfaces isn't a real solution.



Thanks



Sander)

------------------------------------------------------------------------
[2009-07-20 11:07:56] themastersleader at hotmail dot com

I don't understand why this isn't a bug,



When i remove the interface everything works fine,

So by implementing an interface, we say "Implement the same parameters
of the private methods that are defined in the base class, with
exception that the access modifier can be different".



This isn't normal behaviour.



Greets

Sander)

------------------------------------------------------------------------
[2009-07-20 10:56:01] j...@php.net

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php



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


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    http://bugs.php.net/bug.php?id=48984


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

Reply via email to