🔥 Weekly thread #43 of 2021

🔥 This week's code tips for Laravel developers

Lots of cool stuff from @enunomaduro and two competing JSON tips 💪

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

4

🔥 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.