Strict mode in PHP
- Affects how type hints are enforced.
- By default, PHP will try to coerce values of the wrong type to match the expected type.
- In strict mode, PHP will throw a TypeError if the provided value does not exactly match the expected type.
declare(strict_types=1); function add(int $a, int $b): int { return $a + $b; } echo add("5", "10")