Re: Re: [RFC] [Discussion] Literal Scalar Types

From: 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:
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

« previous php.internals (#131642) next »