On 13-06-2021 21:46, someniatko wrote:
> Hi!
> 
> From what I understood reading the RFC, this looks like a new type,
> "literal string", specifically a subtype of "string". Have you
> considered instead of forcing library authors to use `is_literal()`
> check everywhere on their input boundary and making sure no place
> where input is passed, is forgotten, to let them type their whole
> codebase, including internal, against the new `literal-string` type,
> which would be enforced by PHP all the time? From my perspective as a
> PHP developer, it would serve clearer intent than only checking in a
> few places which presumably may take user input, i.e. you could
> explicitly state "this function does only work with literal strings".

That sounds like a great future extension. Then it would be nice to have
the name of the new type match the name of the function that checks for
it. In case the existing 'string' type would be paired with a new
'lstring' type the existing is_string() would pair nicely with a new
is_lstring() function.

Regards,
Dik Takken

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

Reply via email to