Hi Lars,

>thanks for the RFC. Two other questions additionally to what Stas askes:
>
> - What about class type hints and array type hints?

Type hints continue to work as is:

class Foo {
  public function __construct(public stdClass $foo, protected array $bar =
null) {}
}


> - If type hints are possible, doesn¹t it look too much as real property
>type hinting?

It does in the sense the same way as the current mode "enforces" types on
properties. That is, there's no guarantee that types will remain as
initially set, only that the values passed to the constructor must be X
type, ergo the post-ctor values of the props will be of type X. I can see
the argument that it suggests real (permanent) typing where none exists
though.

Thanks,

Sean Cannella | Facebook Eng
If you are smart and persistent, you may find the truth. It is not always
a reward.



--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to