Re: Re: [RFC] [Discussion] Literal Scalar Types
| From: | Tim Düsterhus | Date: | Tue, 30 Jun 2026 18:56:02 +0000 |
| Subject: | Re: Re: [RFC] [Discussion] Literal Scalar Types | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-131642@lists.php.net to get a copy of this message | ||
Hi
Am 2026-06-30 18:14, schrieb Seifeddine Gmati:
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.1. The RFC specifies "Integer literals, with an optional leading minus sign: 1, 0, -1.", are leadingA single leading unary+signs also legal? What about multiple signs or spaces?+or-is accepted, so both-1and+1are legal, and+1denotes the same type as1.
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üsterhusI'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.