Created
November 9, 2015 22:50
-
-
Save jeremysells/b95d4dabf3af522db8e8 to your computer and use it in GitHub Desktop.
Declaration should be compatible with Base
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class ModelA{ | |
public function sayHi() { return "hi"; } | |
} | |
class ModelB extends ModelA { | |
public function sayHi() { return "hello"; } | |
} | |
class SomethingA{ | |
public function doStuff(ModelA $model) { | |
echo $model->sayHi(); | |
} | |
} | |
class SomethingB extends SomethingA{ | |
public function doStuff(ModelB $model) { | |
echo $model->sayHi(); | |
} | |
} | |
$something = new SomethingB(); | |
$something->doStuff(new ModelB()); | |
/** | |
( ! ) Strict standards: Declaration of SomethingB::doStuff() should be compatible with SomethingA::doStuff(ModelA $model) in file.php on line 19 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment