Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HHVM's default locale is C; PHP selects it based on user environment #3011

Closed
atdt opened this issue Jun 23, 2014 · 1 comment
Closed

HHVM's default locale is C; PHP selects it based on user environment #3011

atdt opened this issue Jun 23, 2014 · 1 comment

Comments

@atdt
Copy link
Contributor

atdt commented Jun 23, 2014

 $ hhvm --php -r "var_dump(fnmatch('foob?r', 'foobér'));"
  bool(false)
  $ php5 -r "var_dump(fnmatch('foob?r', 'foobér'));"
  bool(true)

This is because:

$ hhvm --php -r 'var_dump(setlocale(LC_ALL,0));'
string(1) "C"
$ php5 -r 'var_dump(setlocale(LC_ALL,0));'
string(170) "LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=C;LC_COLLATE=C;LC_MONETARY=C;LC_MESSAGES=C;LC_PAPER=C;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=C;LC_IDENTIFICATION=C"

PHP calls setlocale(LC_CTYPE, "") on initialization, but HHVM sticks to the POSIX/C locale.

@fredemmott
Copy link
Contributor

Low pri because it's best practice to explicitly set it anyway to avoid issues where your production environment and development environment differ.

@sgolemon sgolemon self-assigned this Nov 5, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants