Re: [RFC] Scalar Type Hints
| From: | Sven Drieling | Date: | Fri, 02 Jan 2015 22:12:48 +0000 |
| Subject: | Re: [RFC] Scalar Type Hints | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-80111@lists.php.net to get a copy of this message | ||
Am Thu, 1 Jan 2015 14:41:06 +0200
schrieb Zeev Suraski <zeev@zend.com>:
Hallo,
> † Numeric strings with trailing characters and non-numeric strings are
> accepted, but produce a notice.
Why Scalar Type Hints? What is the goal?
- Hints for IDEs - autocompletion?
- Find bugs with static program analysis?
- Find bugs at runtime?
- Help improving the quality of PHP applications
- with notices?
- with errors?
- with ...?
- ...?
Validation of HTML form input is strict. If I know that
$_POST['age'] contains a positive integer why should
foo(int $age) then able to accept float -123.42?
tschuess
[|8:)