Re: [RFC] Scalar Type Hints

From: Date: Sun, 25 Jan 2015 04:19:49 +0000
Subject: Re: [RFC] Scalar Type Hints
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-81107@lists.php.net to get a copy of this message
Hey Stas, > On 25 Jan 2015, at 04:14, Stanislav Malyshev <smalyshev@gmail.com> wrote: > > Hi! > >> going to a vote. That said, I do lean towards always strict, given >> you can usually ensure your return type’s correct. > > Wait, so we would have two modes, strict and non-strict, but also in > non-strict mode, return types still will be strict? Yay, consistency! Yes, it would have that inconsistency, so there’s also the other possibility of being weak for return types in weak mode. Thing is, I haven’t seen (so far) anyone who seems to think return types should be converted. We don’t do this for internal functions (to be fair, there’s no need, C is statically-typed). Them being strict would follow the robustness principle, too: “be conservative in what you send, be liberal in what you accept”. On the other hand, it may not be terribly fitting with “PHP’s weakly-typed nature”. It’s hard to say. -- Andrea Faulds http://ajf.me/

« previous php.internals (#81107) next »