Re: [RFC] is_literal

From: Date: Mon, 14 Jun 2021 10:53:24 +0000
Subject: Re: [RFC] is_literal
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-114857@lists.php.net to get a copy of this message
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


Thread (69 messages)

« previous php.internals (#114857) next »