Bug #79977 [Opn->Nab]: Compatibily with locale

From: Date: Fri, 14 Aug 2020 19:39:37 +0000
Subject: Bug #79977 [Opn->Nab]: Compatibily with locale
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-228596@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=79977&edit=1

 ID:                 79977
 Updated by:         peehaa@php.net
 Reported by:        xyz at ed48 dot com
 Summary:            Compatibily with locale
-Status:             Open
+Status:             Not a bug
 Type:               Bug
 Package:            Arrays related
 Operating System:   Windows
 PHP Version:        8.0.0beta1
 Block user comment: N
 Private report:     N

 New Comment:

This is by design: https://wiki.php.net/rfc/locale_independent_float_to_string


Previous Comments:
------------------------------------------------------------------------
[2020-08-14 19:37:03] 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


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=79977&edit=1


Thread (2 messages)

« previous php.bugs (#228596) next »