Code: Select all
function doStuff(Foo $f)
{
echo $f->printStuff();
}"Fatal error: Argument 1 must be an instance of foo"
But, is it possible to have multiple copies of the same function, but accepting different argument-types?
Code: Select all
function doStuff(Foo $f)
{
echo $f->printStuff();
}
function doStuff(Bar $f)
{
echo $f->deleteStuff();
}
function doStuff(Moo $f)
{
echo $f->printOtherStuff();
}Thanks