The following code:
class Type {
}
function foo(Type $t) {
}
foo(null);
failed at run time:
PHP Fatal error: Argument 1 passed to foo() must not be null
Why is it not allowed to pass null just like other languages?
The following code:
class Type {
}
function foo(Type $t) {
}
foo(null);
failed at run time:
PHP Fatal error: Argument 1 passed to foo() must not be null
Why is it not allowed to pass null just like other languages?