by Joeri · 13y ago · 0 comments
If I make a function meow(MyClass $meow) { } it will throw errors if anything other than a MyClass is given to it, including NULL.
This will only accept an object that is_a MyClass. It can either implement an interface MyClass, extend an abstract MyClass, extend a regular class MyClass, or be the actual object MyClass.
Namespaces have nothing to do with this, other than you being able to use the "use" statement at the top to alias it.