On 18.06.21 08:00, Craig Francis wrote:
As there’s been no issues raised with supporting integers, and doing so
will help adoption, the implementation will be updated to allow them.

Now to choose the name, with the options is_known() from Joe and
is_trusted() from Moritz:

https://strawpoll.com/bd2qed2xs

Keep in mind it might also become a dedicated type in the future.

I think "trusted" is a good option, also if you think about adding it as
a type in the future and how it reads for somebody looking through code.
Something like

public function process(string&trusted $input): string&trusted;

Would be good in terms of readability and captures the meaning quite
well (although having a specific trusted string type might be more
sensible, to avoid these intersection types everywhere). "trusted" could
be used in a similar way like the "pure" annotations in Psalm/PHPStan
(just for a different meaning of course): to signify where non-trusted
variables should be reported and could even be used for whole objects to
signify they should only ever get and return trusted variables.

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

Reply via email to