class myClass {
function myFunct(Foo $var) {
...
}
function otherFunct(myClass $other) {
...
}
}
I've seen this declaration couple times in php manual however i dont get it, in this particular example what purpose it serving to have Foo
and/or myClass
in arguments list for a function?
Is there any use for this declaration outside of class?
Never mind i found it called type declaration (type hints) http://php.net/manual/en/functions.arguments.php#functions.arguments.type-declaration