Last active
August 29, 2015 14:15
-
-
Save till/28b931b083b856858aa5 to your computer and use it in GitHub Desktop.
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 | |
class A | |
{ | |
public function hello(B $b) | |
{ | |
echo "Hello {$b->person}" . PHP_EOL; | |
} | |
} | |
class B | |
{ | |
public $person = 'Till'; | |
} | |
class C extends A | |
{ | |
public function hello($name) | |
{ | |
echo "Hello {$name}" . PHP_EOL; | |
} | |
} | |
$a = new A; | |
$b = new B; | |
$a->hello($b); | |
$c = new A; | |
$c->hello('Nils'); |
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 | |
class A | |
{ | |
public function sum(int $number, int $anotherNumber) | |
{ | |
// | |
} | |
} | |
class B extends A | |
{ | |
public function sum($number, int $anotherNumber) | |
{ | |
// | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment