On 07/13/2015 12:16 AM, Robert Stoll wrote:
> Another point of discussion should be how strict a property type hint will 
> be. Currently, parameter type hints are only binding for the call side but 
> not within the function body.
> For instance, function foo(Foo $x){ $x = 1;} is perfectly valid. It certainly 
> has little sense to have the same semantics for properties but then we 
> introduce another inconsistency and should maybe fix the behaviour of 
> parameter type hints first.

Like I said, adding type checks to every assignment is a rather large
change, and I doubt it can be done without some nasty performance costs.

Honestly, I would rather have a speedy runtime and put the effort into a
static analysis mode built into PHP. The stated goal of so many who push
the strict types everywhere argument is that it helps find bugs. So
let's have an analyze mode that finds these bugs without bogging down
the runtime with thousands of type checks.

-Rasmus


Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to