PHP 8 Nullsafe operator - Safely allow nulls to be returned in PHP method calls

preview_player
Показать описание
Learn how to use the Nullsafe operator in PHP 8.
Before PHP 8 calling a method on an object which was null would throw a fatal error. The nullsafe operator can be used that handles null values on method calls.

📖 Related programming courses:

PHP Array Course

PHP OOP Course

JavaScript Array Course

*****

******
Follow How To Code Well

******
Support How To Code Well
Be a member on Patreon:
Buy me a coffee:

#shorts #phpShorts #php
Рекомендации по теме
Комментарии
Автор

Ooh, great tip I will definitely start using this!!

keepawayfromthetrout
Автор

Wow 😅 I used isset and various other workarounds like setting current time as default when possible to avoid this.

eric
welcome to shbcf.ru