Re: [RFC] Scalar Type Hints v0.2
| From: | Jordi Boggiano | Date: | Thu, 15 Jan 2015 16:04:18 +0000 |
| Subject: | Re: [RFC] Scalar Type Hints v0.2 | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-80562@lists.php.net to get a copy of this message | ||
On 15/01/2015 16:01, Pavel Kouřil wrote:
On Thu, Jan 15, 2015 at 4:35 PM, Jordi Boggiano <j.boggiano@seld.be> wrote:No I am saying if it passes *without* declare then people wishing to use strict types would have to build their own typing, effectively removing the choice from these library's users as to whether they want strict hints or not. It's just an argument in favor of having declare(). Cheers -- Jordi Boggiano @seldaek - http://nelm.io/jordiI mean that if someone wants strict typing they won't want to use weak hints because that would coerce the data before they can verify it and ensure their code is strictly typed. Therefore the best course of action is to have no hint + check manually, like they are doing now with such libs.I'm sorry, but I still don't follow. For the writer of a library, he is always guaranteed to get the types he wants (declared in typehints) and therefore checking inside the method doesn't really make any sense. Or are you saying that developers would use checks inside of methods instead of typehints, even if the RFC passed in its current state with the declare() statement?