'Null check on type hinting php [duplicate]
public function update(?User $user, Post $post)
{
return $user->id === $post->user_id;
}
In the above function there is a '?' in front of User model type hinting.
What is the use case of this operator in function parameter?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
