RE: [PHP-DEV] Scalar Type Hints v0.4
| From: | François Laupretre | Date: | Wed, 18 Feb 2015 16:28:21 +0000 |
| Subject: | RE: [PHP-DEV] Scalar Type Hints v0.4 | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-83089@lists.php.net to get a copy of this message | ||
> De : Pádraic Brady [mailto:padraic.brady@gmail.com]
>
> However, “123” is exceptional. It’s redefining an integer as “ an
> integer or a string comprised wholly of digits without leading zeroes,
> with an optional leading hyphen, and representing an integer up to
> PHP_INT_MAX”
Add leading zeros, and leading/trailing blanks and I think it is still strict enough.
> Then again, it’s an exception that requires a long sentence. It’s just
> not clear, to me, if this is the sole intended exception, or if that
> sentence needs to be expanded to a paragraph. A section? Are we going
> to need a chapter? I’m assuming octals-in-a-string are a no-go to be
> coerced whereas others might just see an integer with superfluous
> leading zeroes.
Leading zeros to recognize octal string are not an option, but alternative non ambiguous syntax is
possible, in theory.
'0x'-prefixed hexa is possible too. Thoughts ?
> In a future RFC revision, it might be nice to have a table of the
> specific coercion rules applicable to a weak/strong/single-unified
> option.
I am currently writing this.
Regards
François