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
 [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

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-08-14 19:39 UTC] peehaa@php.net
-Status: Open +Status: Not a bug
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 15:01:29 2024 UTC