-
Notifications
You must be signed in to change notification settings - Fork 811
document setlocale(LC_ALL, null) to retrieve current setting #4765
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
Conversation
<para> | ||
<example> | ||
<title><function>setlocale</function> Retrieve current setting</title> | ||
<programlisting role="php" annotations="non-interactive"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this actually non-interactive?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't know (1st time I see this attribute)
This is a copy-paste of the other example ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is for enabling running the example code on the docs website. But okay, if the other does not have it, it likely has a reason.
Unfortunately, it seems more complicated than that. A locale of "0" maps to NULL in the C code: This means that Passing NULL in PHP transforms it to the string "" in the C code, i.e. The difference between C/PHP should be cleared up in this page. |
Sorry, I merged the fix before seing your last comment.
Yes, I noticed this part of the code, But this doesn't work
Only null (or empty string) return the current setting |
glibc documentation seems terribly confusing
And the example in https://sourceware.org/glibc/manual/latest/html_node/Setting-the-Locale.html
Edit: understood In C: null return the current setting from a previous call, empty string set and return setting (from env)
|
See PR #4770 |
Document how it works (since always)
ping @nielsdos as related to php/php-src#19070