Bug #81019 [NEW]: Unable to close NumberFormatter after failed parse()
| From: | corey dot taylor dot fl at gmail dot com | Date: | Sat, 08 May 2021 03:31:40 +0000 |
| Subject: | Bug #81019 [NEW]: Unable to close NumberFormatter after failed parse() | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-233741@lists.php.net to get a copy of this message | ||
From: corey dot taylor dot fl at gmail dot com
Operating system:
PHP version: 8.0.6
Package: Unknown/Other Function
Bug Type: Bug
Bug description:Unable to close NumberFormatter after failed parse()
Description:
------------
After calling
NumberFormatter::parse() with an invalid string, cloning
the NumberFormatter instance throws a Fatal Error:
$format = new NumberFormatter('en_US', NumberFormatter::DECIMAL);
$format->parse('abc');
clone $format;
Fatal error: Uncaught Exception: Failed to clone NumberFormatter object
https://3v4l.org/XGVWZ
This seems to only occur with PHP 8.0+. Since parse() returns false on
error, I wouldn't expect it to invalidate the object.
I was not sure what category this bug report falls under.
--
Edit bug report at https://bugs.php.net/bug.php?id=81019&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=81019&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=81019&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=81019&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=81019&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=81019&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=81019&r=support
Expected behavior: https://bugs.php.net/fix.php?id=81019&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=81019&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=81019&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=81019&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=81019&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=81019&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=81019&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=81019&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=81019&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=81019&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=81019&r=mysqlcfg