The declare(strict_types=1) directive must
be the first statement in a file. If it appears anywhere else in the
file it will generate a compiler error. Block mode is also explicitly
disallowed (declare(strict_types=1); is the only allowed form).
Like the encoding directive, but unlike the ticks directive, the strict_types
directive only affects the specific file it is used in, and does not affect either other files which include the file nor other files that are included by the file.
I would think the at the very least you’ll have to run a search/replace on the opening <?php of each file to add in the strict type declaration. Although, you’re not really getting the full benefit unless you refactor the existing code to use the additional type declarations (int, string, float and bool) and declare function/method return types.