php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79977 Compatibily with locale
Submitted: 2020-08-14 19:37 UTC Modified: 2020-08-14 19:39 UTC
From: xyz at ed48 dot com Assigned:
Status: Not a bug Package: Arrays related
PHP Version: 8.0.0beta1 OS: Windows
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: xyz at ed48 dot com
New email:
PHP Version: OS:

 

 [2020-08-14 19:37 UTC] xyz at ed48 dot com
Description:
------------
In PHP 7.4.9 the script runs with no problem, however, in PHP 8.0.0 beta1, it does not obey LOCALE.

Test script:
---------------
<?php
$arr01 = [ 2.876, 8.0, 18.91, 32.12 ];
echo 'The given ARRAY:<br>';
print_r($arr01);
echo '<br><br>The SUM:<br>';
setlocale(LC_NUMERIC, 'pt-pt', 'pt_PT');
$sarr01 = array_sum($arr01);
echo $sarr01 . '<br>';
?> 

Expected result:
----------------
61,906 

Actual result:
--------------
The SUM (PHP 7.4.9):
61,906 

The SUM (PHP 8.0.0 b1):
61.906

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-08-14 19:39 UTC] peehaa@php.net
-Status: Open +Status: Not a bug
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 02 11:01:36 2025 UTC