What do strict types do in PHP?

I’ve seen the following new line in PHP 7, but nobody really explains what it means. I’ve googled it and all they talk about is will you be enabling it or not like a poll type of thing.

declare(strict_types = 1);

What does it do? How does it affect my code? Should I do it?

Some explanation would be nice.

2 Answers
2

Leave a Comment