Re: is_digits() and digits type
| From: | Rowan Collins | Date: | Thu, 14 May 2015 09:19:26 +0000 |
| Subject: | Re: is_digits() and digits type | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-86214@lists.php.net to get a copy of this message | ||
Yasuo Ohgaki wrote on 14/05/2015 06:19:
I guess DbC will not prevent users from abusing type hints, though.They'll only "abuse" them in exactly the same way they currently "abuse" existing checks and casts. e.g. $id = intval($_GET['id']); looks perfectly reasonable to most people, but if you want to use a 64-bit ID on a 32-bit system, you will consider that a bug. If someone uses an int typehint for the same purpose then it is, equally, a bug. The result of one will probably be retrieving the wrong data, and thus potential leak or corruption; the result of the other will probably be a fatal error, which at least stops the broken code in its tracks. Regards, -- Rowan Collins [IMSoP]