Re: [PHP-DEV] Re: [RFC] [Discussion] Literal Scalar Types

[email protected] (Tim Düsterhus)
Newsgroups php.internals
Message-ID <[email protected]>
Hi

Am 2026-06-30 18:14, schrieb Seifeddine Gmati:
>> 1. The RFC specifies "Integer literals, with an optional leading minus
>> sign: 1, 0, -1.", are leading `+` signs also legal? What about 
>> multiple
>> signs or spaces?
> 
> A single leading unary `+` or `-` is accepted, so both `-1` and `+1` 
> are
> legal, and `+1` denotes the same type as `1`.

I was confused for a bit, because you didn't adjust the quoted section 
(https://wiki.php.net/rfc/literal_scalar_types#integer_literals) and 
instead only adjusted the “Accepted literal syntax” section, which is 
misleading / makes the RFC internally inconsistent. It probably makes 
sense to merge the “Accepted literal syntax” section into the three 
sections above as appropriate.

>> I'm also concerned about folks shooting themselves in the foot with 
>> type
>> checking performance for "wide unions of literal types". It might make
>> sense to provide a dedicated performance section in the RFC.
> 
> Added.

Thanks that looks good to me.

-------

Except for the remark about the literal syntax above, I don't have any 
further comments to the RFC (text).

Best regards
Tim Düsterhus
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.