Re: PHP5: Class behavior: method overloading

From: Date: Thu, 26 Feb 2004 18:53:08 +0000
Subject: Re: PHP5: Class behavior: method overloading
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-8177@lists.php.net to get a copy of this message
I say keep compatibility. If you want to enforce this, then declare an interface. That is after all why they exist. Walt > Hello, > > in the latest snapshot i found some very important differences to the php5 > beta 4 version concerning the behavior of inherited classes. please look at > the following example: > > <pre> > <?php > class MyClass extends MyParent{ > function test($arg) { > > } > } > > class MyParent { > function test($arg1, $arg2) { > > } > } > > $obj = new MyClass(); > ?> > </pre> > > the output is: > > Fatal error: Declaration of MyClass::test() must be compatible with that of > MyParent::test() in ... on line 3 > > > I think that this is a nice feature in the face of "compatibility", but may > cause in a complete restructure of existing class trees. The consequence is > a bad :( backward compatibility!! Personally I think it would be a good > solution to set an option in the configuration or something like this. > > other oppinions would be appreciated. > > thanks, > vivi > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.internals (#8177) next »