Re: [RFC:generics]
| From: | Larry Garfield | Date: | Thu, 21 Apr 2016 22:31:00 +0000 |
| Subject: | Re: [RFC:generics] | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-92615@lists.php.net to get a copy of this message | ||
On 4/21/16 10:43 AM, Rowan Collins wrote:
guilhermeblanco@gmail.com wrote on 21/04/2016 16:25:Creating a one off class or interface to handle intersection cases works iff you control all creation points for all objects that you may encounter. That is rarely the case when dealing with 3rd party libraries, as is now typical. -- --Larry GarfieldI understand others mentioned we could create a new interface that wraps the other two interfaces, but that still doesn't solve the problem where I want to extend a class AND also implement a specific interface.I covered this case in my previous mail: you can create an abstract class that extends a concrete class and adds an interface to it, and the extra methods are implicitly added as abstract for descendants to implement: