|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull Requests
Pull requests:
HistoryAllCommentsChangesGit/SVN commits
[2017-02-09 15:01 UTC] andrew dot nester dot dev at gmail dot com
[2017-03-27 13:06 UTC] testingteam2 at gmail dot com
[2020-01-26 16:04 UTC] cmb@php.net
-Status: Open
+Status: Verified
[2020-01-26 16:04 UTC] cmb@php.net
[2020-01-26 16:06 UTC] cmb@php.net
[2020-01-30 09:13 UTC] cmb@php.net
[2020-01-30 09:13 UTC] cmb@php.net
-Status: Verified
+Status: Closed
[2020-01-30 09:15 UTC] cmb@php.net
-Assigned To:
+Assigned To: cmb
[2020-01-30 09:16 UTC] cmb@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 00:00:02 2025 UTC |
Description: ------------ A NumberFormatter instance retrieved from the session generates an 'Found unconstructed NumberFormatter: U_ILLEGAL_ARGUMENT_ERROR' on calling ::format(). The code snippet below can be run from the in-built webserver. The second time the page is requested (within a session), the above error is reported. Test script: --------------- session_start(); if(isset($_SESSION["currencyFormatter"])){ $formatter = $_SESSION["currencyFormatter"]; echo "loaded formatter from session\n"; } else { echo "no formatter on session\n"; $formatter = new NumberFormatter("en_GB", NumberFormatter::CURRENCY); $_SESSION["currencyFormatter"] = $formatter; } var_dump($formatter->format(123, NumberFormatter::CURRENCY)); if(intl_is_failure($formatter->getErrorCode())) { echo "\n" . $formatter->getErrorMessage(); } session_commit(); Expected result: ---------------- First request: no formatter on session string '£123.00' (length=8) Subsequent requests: loaded formatter from session string '£123.00' (length=8) Actual result: -------------- First request: no formatter on session string '£123.00' (length=8) Subsequent requests: loaded formatter from session boolean false Found unconstructed NumberFormatter: U_ILLEGAL_ARGUMENT_ERROR