Created
September 16, 2013 19:43
-
-
Save Trainmaster/6585549 to your computer and use it in GitHub Desktop.
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 | |
class Parents | |
{ | |
public function doSomething($x) | |
{ | |
print $x; | |
} | |
} | |
class ChildA extends Parents | |
{ | |
public function doSomething($x) | |
{ | |
print_r (func_get_args()); | |
} | |
} | |
class ChildB extends Parents | |
{ | |
public function doSomething($x, $y) | |
{ | |
print_r (func_get_args()); | |
} | |
} | |
$child = new ChildA; | |
$child->doSomething('x', 'y'); | |
$child->doSomething(); | |
interface BazInterface | |
{ | |
public function doSomething($x); | |
} | |
class BazA implements BazInterface | |
{ | |
public function doSomething() | |
{ | |
} | |
} | |
class BazB implements BazInterface | |
{ | |
public function doSomething($x, $y) | |
{ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment