ID:               42439
 Updated by:       [EMAIL PROTECTED]
 Reported By:      romain dot tartiere at healthgrid dot org
-Status:           Open
+Status:           Bogus
 Bug Type:         Class/Object related
 Operating System: GNU/Linux
 PHP Version:      5.2.3
 New Comment:

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




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

[2007-08-27 09:35:06] romain dot tartiere at healthgrid dot org

Description:
------------
Considering a class that implements an interface and has methods that
require many arguments. You may expect to make your life easier
derivating this class and providing simpler methods.

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

interface i_foo {
        function fooize($str, $n);
}

class c_foo implements i_foo { /* painful ($class->fooize($str, $n))
*/
        function fooize($str, $n) {
                echo "$str $n\n";
        }
}

class c_bar extends c_foo {
        function fooize($str) { /* simple ($class->fooize($str)) */
                $n = strlen($str);
                parent::fooize($str, $n);
        }
}

?>

Expected result:
----------------
This should not pose any kind of problem.

Actual result:
--------------
Fatal error: Declaration of c_bar::fooize() must be compatible with
that of i_foo::fooize()


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


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

Reply via email to