Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

[Bug]: Locale Variable Changes After PHP Update Cause Inconsistent Output

未关闭
#1,282 8 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
php

调研方向

首先,在 macOS 上使用 PHP 8.2.27、8.3.17 和 8.4.4 重现报告中的差异,并将终端中的 locale 输出与 localeconv() 进行比较。确定 PHP runtime 是否继承了 macOS 的 locale,并明确预期的一致行为;该 issue 未指出需要更新的源文件或测试。

由索引模型根据 Issue 内容生成。

描述

macOS waiting for upstream fix
Platform

macOS

Operating system version

15.3 (24D60)

System architecture

ARM64 (M1, M2, etc)

Herd Version

1.14.1

PHP Version

Last Version of PHP 8.3.17 and 8.4.4

Bug description

After updating PHP to its latest versions (8.4.4 and 8.3.17), the default value of the locale variables changed. PHP started using the locale variables from the OSX operating system. In my case, this becomes a problem because the software I work with does not have the same locale settings as mine.

I know there are several ways to solve this through PHP code using setlocale, but the strange thing is that when I run the tests in PhpStorm, I still get the previous output(PHP 8.2.27).

Steps to reproduce

At terminal, when i run locale
I get the output below

LANG="pt_BR.UTF-8"
LC_COLLATE="pt_BR.UTF-8"
LC_CTYPE="pt_BR.UTF-8"
LC_MESSAGES="pt_BR.UTF-8"
LC_MONETARY="pt_BR.UTF-8"
LC_NUMERIC="pt_BR.UTF-8"
LC_TIME="pt_BR.UTF-8"
LC_ALL=
When i dump localeconv();
PHP 8.2.27
array:18 [
  "decimal_point" => "."
  "thousands_sep" => ""
  "int_curr_symbol" => ""
  "currency_symbol" => ""
  "mon_decimal_point" => ""
  "mon_thousands_sep" => ""
  "positive_sign" => ""
  "negative_sign" => ""
  "int_frac_digits" => 127
  "frac_digits" => 127
  "p_cs_precedes" => 127
  "p_sep_by_space" => 127
  "n_cs_precedes" => 127
  "n_sep_by_space" => 127
  "p_sign_posn" => 127
  "n_sign_posn" => 127
  "grouping" => []
  "mon_grouping" => []
]
PHP 8.3.17 and 8.4.4
array:18 [
  "decimal_point" => ","
  "thousands_sep" => "."
  "int_curr_symbol" => "BRL "
  "currency_symbol" => "R$"
  "mon_decimal_point" => ","
  "mon_thousands_sep" => "."
  "positive_sign" => ""
  "negative_sign" => "-"
  "int_frac_digits" => 2
  "frac_digits" => 2
  "p_cs_precedes" => 0
  "p_sep_by_space" => 1
  "n_cs_precedes" => 0
  "n_sep_by_space" => 1
  "p_sign_posn" => 1
  "n_sign_posn" => 1
  "grouping" => array:2 [
    0 => 3
    1 => 3
  ]
  "mon_grouping" => array:2 [
    0 => 3
    1 => 3
  ]
]
Relevant log output

主要语言
没有语言数据
星标
124
派生
1
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

beyondcode/herd-community 的其他 Issue

查看 beyondcode/herd-community 的全部 Issue

相似的 Issue

更多 Backend & API Design Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。