Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta
#1,282 8 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
php

Direzione di ricerca

Inizia riproducendo la differenza segnalata con PHP 8.2.27, 8.3.17 e 8.4.4 su macOS, confrontando l'output di locale nel terminale con localeconv(). Determina se il runtime PHP sta ereditando la locale di macOS e stabilisci quale sia il comportamento coerente atteso; l'issue non identifica alcun file sorgente o test da aggiornare.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
Nessun dato sulla lingua
Stelle
124
Fork
1
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di beyondcode/herd-community

Tutte le issue di beyondcode/herd-community

Issue simili

Altre issue su Backend & API Design

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.