Use declare(strict_types=1) to enable strict mode for type checking

Use declare(strict_types=1) to enable strict mode for type checking

PHP reminder: The "declare(strict_types = 1);" directive enables strict mode. In strict mode, only a variable of exact type of the “type declaration” will be accepted, or a "TypeError" will be thrown. ✅

We're writing a book, you can get it for free here.