PHPnews.io

Overview for 'tomasvotruba'

Why Class&nbspConstants Should be Typed

Written by Tomáš Votruba / Original link on Jun. 22, 2020

Do you used PHP 7.4 [typed properties](/blog/2018/11/15/how-to-get-php-74-typed-properties-to-your-code-in-few-seconds/)? Do you know why?I use them, so **I don't have to think and validate the property type** every time. We just know its the type or PHP would crash otherwise.Until PHP 7.4 this was …