Doc #80716 [NEW]: bad regular expression for float format
| From: | jonathan dot poelen+php at gmail dot com | Date: | Sat, 06 Feb 2021 06:15:29 +0000 |
| Subject: | Doc #80716 [NEW]: bad regular expression for float format | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-18512@lists.php.net to get a copy of this message | ||
From: jonathan dot poelen+php at gmail dot com
Operating system:
PHP version: Irrelevant
Package: Documentation problem
Bug Type: Documentation Problem
Bug description:bad regular expression for float format
Description:
------------
---
From manual page: https://php.net/language.types.float
---
The bnf is:
LNUM [0-9]+(_[0-9]+)*
DNUM ([0-9]*(_[0-9]+)*[\.]{LNUM}) |
({LNUM}[\.][0-9]*(_[0-9]+)*)
EXPONENT_DNUM (({LNUM} | {DNUM}) [eE][+-]? {LNUM})
Unfortunately, these accept _123.45 or 123._45 as float. DNUM should be
DNUM ({LNUM}?[\.]{LNUM}) | ({LNUM}[\.])
I think there is a missing float rule that combines DNUM and
EXPONENT_DNUM.
float {EXPONENT_DNUM} | {DNUM}
Finally, it seems strange to me to have [\.] instead of \. or [.] and
the format used is not the same as on the integer page:
https://www.php.net/manual/en/language.types.integer.php
--
Edit bug report at https://bugs.php.net/bug.php?id=80716&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=80716&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=80716&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=80716&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=80716&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=80716&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=80716&r=support
Expected behavior: https://bugs.php.net/fix.php?id=80716&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=80716&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=80716&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=80716&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=80716&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=80716&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=80716&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=80716&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=80716&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=80716&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=80716&r=mysqlcfg