Php cast to class using PHPDoc
- Language:: PHP
- Type:: Back-end
- Context:: When casting a variable to a specific type for hinting and to fix undefined method or property errors
- Snippet
/** @var User $user */
$user = $u[0];- Dependencies::
Mar 13, 20261 min read
/** @var User $user */
$user = $u[0];