On Fri, 18 Jun 2021 at 8:48 am, Pierre <pierre-...@processus.org> wrote:

> Le 18/06/2021 à 08:00, Craig Francis a écrit :
> > Keep in mind it might also become a dedicated type in the future.
>
> Hello,
>
> If so, why the question should not be about the type name instead ? It
> might raises different concerns and new arguments to this discussion ?
>
> What is this type ? What does it covers ? Can float, int, etc... be
> literals as well ? Are those subtypes of their actual existing related
> type ? What should be the behavior regarding user method typings, etc etc ?
>
> Instead of introducing is_literal() may be directly introducing those
> types could be a good idea as well ?



Hi Pierre,

On Monday we had the discussion about types:

https://externals.io/message/114835#114846

The RFCs Future Scope was updated to note the suggestion from someniatko
and Matthew about how this could be a type in the future (Joe has also
shown an interest); where it was agreed that it should be added later.

The discussions I’ve had about this flag have been to ensure it covers all
future use cases, including a dedicated type, where the function is an easy
way to expose this flag to libraries today, so they can handle developer
mistakes gracefully (rather than causing type errors), with types needing
to have their own future/separate discussion.

The type will still use this flag, so it will match the same definition in
the RFC - strings defined by the programmer, and we will include integers
after the feedback from Matthew (integers have always been considered, the
only reason they were originally excluded was because I tried to keep the
definition as small as possible, Matthew noted how they would help
adoption, and no one can find a single issue with allowing them).

The RFC also explains why floats and booleans are not included, so wouldn’t
be used by the type for the same reason.

While adding a flag is an ideal to work towards, it is more important to
have this simple change first, so it can start improving security
immediately (so libraries don’t need to wait years for all of their
supported versions of PHP to include the type), and it gives libraries full
freedom in how they handle values which don’t have this flag.

Hopefully this and the Future Scope section can also answer your questions.

Craig

Reply via email to