OakBehringer Posted March 2, 2007 Share Posted March 2, 2007 Hi. Could someone please tell me why this doesn't work? <?php interface iFace { } class ManFace implements iFace {} class WomanFace implements iFace {} interface iJerk { function slap (iFace $f); } class Pimp implements iJerk { function slap (WomanFace $f) {} } ?> Fatal error: Declaration of Pimp::slap() must be compatible with that of iJerk::slap() in C:\Inetpub\wwwroot\www.networkautomation.com\order_new\test.php on line 12 Shouldn't class Pimp be able to restrict slap()'s parameter to WomanFace since WomanFace implements the iFace interface? Link to comment https://forums.phpfreaks.com/topic/40884-inheritance-confusion/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.