PHP Strict Types
PHP gets enough flack for being insecure and untamed. Moving toward stronger security and stricter coding is one of the benefits of PHP 7+
The short answer is you should pretty much always use
strict_types whenever possible, these days. However, if you’re upgrading old code, you of course need to be sure that everything works correctly after adding
strict_types, because the PHP engine will interpret it more strictly.
It is also worth nothing that current implementation is not very aggressive, so you can still include PHP files (etc) in other files, and it will not necessarily break them if their code does not follow same type suit.
And yes, you have to declare it at the top of every single script 🙂