Re: [RFC] Scalar Type Hints v0.2

From: Date: Mon, 02 Feb 2015 14:25:01 +0000
Subject: Re: [RFC] Scalar Type Hints v0.2
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-81587@lists.php.net to get a copy of this message
Hello Andrea, On 02.02.15 00:49, Andrea Faulds wrote: > The RFC has been updated to cover return types, since Levi’s Return Types RFC has passed. The > patch is a work in progress: it works, but lacks tests for return types. > > Version 0.3 of the RFC can be found here: > https://wiki.php.net/rfc/scalar_type_hints although my involvement here is very sparse at the moment, please let me tell you that I a) find it great that you don't give up, are persistently going for your idea while b) still being objective rather then emotional. I'm really happy to see such technical, lively discussion you initiated so far. Thank you :-) That said ... - I dislike the RFC since the introduction of the declare() adaption (effectively 0.2/0.3 now) and did not 100% agree with 0.1 - Since consensus on the strict mode does part the community (or, the greater community also outside @internals) my impression is that the current best way to move forward would be - get the rfc to only go for weak types for now - using the "cast-like syntax": function foo( (int) $bar ); and ultimately keep the strict type out for /now/ and try it at a later time, the "function foo( int $bar )"-syntax. I'm actually not really in favor of just weak types, I would consider myself a "strict type" voter, but through the community communication here I saw a) the benefits of weak types hinting/casting b) without getting in the way of a possible future strict type (e.g. with the "non-cast-like syntax"). thank you, - Markus

« previous php.internals (#81587) next »