Skip to content

Instantly share code, notes, and snippets.

@Trainmaster
Created September 16, 2013 19:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Trainmaster/6585549 to your computer and use it in GitHub Desktop.
Save Trainmaster/6585549 to your computer and use it in GitHub Desktop.
signature
<?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