Re: [RFC] Scalar Type Hints v0.2

From: Date: Thu, 15 Jan 2015 15:29:39 +0000
Subject: Re: [RFC] Scalar Type Hints v0.2
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-80552@lists.php.net to get a copy of this message
Hi Jordi, > On 15 Jan 2015, at 15:11, Jordi Boggiano <j.boggiano@seld.be> wrote: > > On 14/01/2015 00:16, Andrea Faulds wrote: >> Here: https://wiki.php.net/rfc/scalar_type_hints >> >> This is a new thread because I’ve made a significant revision to the RFC, so it’d be >> sensible to separate discussion of the updated RFC from the v0.1 RFC. > > Reading the thread at this point shows so much confusion, it seems half the people reading the > spec misunderstood that the declare() line affects function calls only and not the > API/implementation level. > > As much I think it was a smart idea and workaround, it is perhaps too clever for its own good > if nobody gets it. > > Anyway, as v0.2 appears to be v0.1 + declare(), why not keep those two options separated in the > vote? > > a) should be add weak typing > b) should we also add declare() for to get strict typing at call-site. > > If *a* passes it would be a great stepping stone towards adding *b* later perhaps, or tweaking > internal coercion rules to improve the behavior of the weak types, having scalars in return hints > (since return hints seem likely to pass), etc. > > If *b* passes as well great we have a complete picture and every team can have declare() Y/N in > their own coding guidelines based on preference. I may consider another RFC that just does weak typing, or reviving v0.1 if this RFC doesn’t pass. But I’m not really sure about it. I’m not sure it’s fair on all the people who would prefer a strict approach. -- Andrea Faulds http://ajf.me/

« previous php.internals (#80552) next »