What does strict types do in PHP?
问题 I've seen this new line in PHP7 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. 回答1: From Treehouse blog : With PHP 7 we now have added Scalar types. Specifically: int, float, string, and bool. By adding scalar type hints and enabling strict requirements, it is hoped that more