Skip to content

Instantly share code, notes, and snippets.

@till
Last active August 29, 2015 14:15
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 till/28b931b083b856858aa5 to your computer and use it in GitHub Desktop.
Save till/28b931b083b856858aa5 to your computer and use it in GitHub Desktop.
<?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');
<?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