Created
May 30, 2011 20:15
-
-
Save GodsBoss/999405 to your computer and use it in GitHub Desktop.
Constructor signature
This file contains 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 | |
interface Something{} | |
interface AnotherThing{} | |
class Foo{ | |
public function __construct(Something $thing){} | |
public function foo(Something $thing){}} | |
// No problem. | |
class FooSomeChild extends Foo{ | |
public function __construct(AnotherThing $thing){}} | |
// Works, but PHP complains. | |
class FooAnotherChild extends Foo{ | |
public function foo(AnotherThing $thing){}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment