[php-src] Issue #14119: Set declare(strict_types=1) as Default Behavior
| From: | rcsofttech85 | Date: | Fri, 03 May 2024 05:30:32 +0000 |
| Subject: | [php-src] Issue #14119: Set declare(strict_types=1) as Default Behavior | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-246851@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/14119
Author: rcsofttech85
### Description
This feature request proposes making declare(strict_types=1) the default behavior for all PHP
scripts. This directive enables strict type checking, which improves code clarity, reduces runtime
errors, and promotes better coding practices.
Developers who prefer to maintain loose typing would still have the option to explicitly disable it
using declare(strict_types=0). This would allow for compatibility with legacy code or specific use
cases.