Bug #79317 [NEW]: opcache and setlocale issue

From: Date: Fri, 28 Feb 2020 12:28:29 +0000
Subject: Bug #79317 [NEW]: opcache and setlocale issue
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-225777@lists.php.net to get a copy of this message
From:             j dot arnold at qaamgo dot com
Operating system: OpenSuse 15.1
PHP version:      7.4.3
Package:          opcache
Bug Type:         Bug
Bug description:opcache and setlocale issue

Description:
------------
When executing the code below with "?lang=de_DE", the first call will
result in a float with comma in the concatenated string. On the second
call this will result in a float with a dot.

When disabling opcache the issue is gone and it is always a comma.
Also in php 7.3 this issue does not occure.

So it seems that opcache is ignoring the setlocale.

Test script:
---------------
class Test {
    function __construct() {
        // call https://domain.tld?lang=de_DE
        // first call will result in a float with COMMA in the
concatenated string
        // second call will result in a float with DOT in the
concatenated string

        if ($_GET['lang']) {
            setlocale(LC_ALL, $_GET['lang'] . '.utf-8');
        }

        $z = 0.5;
        $y = $z . ' invalidate cache for this class by changing
something here: v1';
        echo 'Concatenated string: ' . $y . '<br />';
        echo 'Plain Variable: ';
        echo $z;
        echo '<br />';
        exit;
    }
}

$test = new Test();

Expected result:
----------------
The float will always be with ",".


-- 
Edit bug report at https://bugs.php.net/bug.php?id=79317&edit=1
-- 
Fix committed:                    https://bugs.php.net/fix.php?id=79317&r=fixed
Fixed in release:                 https://bugs.php.net/fix.php?id=79317&r=alreadyfixed
Need backtrace:                   https://bugs.php.net/fix.php?id=79317&r=needtrace
Need Reproduce Script:            https://bugs.php.net/fix.php?id=79317&r=needscript
Try newer version:                https://bugs.php.net/fix.php?id=79317&r=oldversion
Not developer issue:              https://bugs.php.net/fix.php?id=79317&r=support
Expected behavior:                https://bugs.php.net/fix.php?id=79317&r=notwrong
Not enough info:                  https://bugs.php.net/fix.php?id=79317&r=notenoughinfo
Submitted twice:                  https://bugs.php.net/fix.php?id=79317&r=submittedtwice
register_globals:                 https://bugs.php.net/fix.php?id=79317&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=79317&r=phptooold
Daylight Savings:                 https://bugs.php.net/fix.php?id=79317&r=dst
IIS Stability:                    https://bugs.php.net/fix.php?id=79317&r=isapi
Install GNU Sed:                  https://bugs.php.net/fix.php?id=79317&r=gnused
Floating point limitations:       https://bugs.php.net/fix.php?id=79317&r=float
No Zend Extensions:               https://bugs.php.net/fix.php?id=79317&r=nozend
MySQL Configuration Error:        https://bugs.php.net/fix.php?id=79317&r=mysqlcfg


Thread (8 messages)

« previous php.bugs (#225777) next »