Union types allow to combine several types. This video shows all the benefits they offer, especially in a dynamically typed langague such as PHP.
💸 Buy the full Front Line PHP course with a nice discount by using this link: https://spatie.be/products/front-line...
Links:
• Front Line PHP; the book that explains all PHP 8 features and modern PHP in depth: https://front-line-php.com/
• The union types RFC: https://wiki.php.net/rfc/union_types_v2
📦 Check out our open source packages: https://spatie.be/open-source
❤️ Support us: https://spatie.be/open-source/support-us
🐦 Twitter: / spatie_be
🔷 Facebook: / spatie.be
📸 Instagram: / spatie_be