Skip to content

Conversation

@peter-gribanov
Copy link
Contributor

https://www.php.net/manual/en/function.setlocale.php

If locale is NULL or the empty string "", the locale names will be set from the values of environment variables with the same names as the above categories, or from "LANG".
If locale is "0", the locale setting is not affected, only the current setting is returned.

@ondrejmirtes
Copy link
Member

Is it supposed to be integer 0 or string "0"?

@peter-gribanov
Copy link
Contributor Author

Is a integer, not a string.

@peter-gribanov
Copy link
Contributor Author

peter-gribanov commented Oct 19, 2020

No, though. Wait. It seems i'm wrong.

@peter-gribanov
Copy link
Contributor Author

It is not obvious to me from the documentation which data type should be used. Integer is most commonly used. It's not obvious to me in the source either. Both options work the same way.

@ondrejmirtes
Copy link
Member

Yeah, these functions are weird, the documentation talks about string only though. I'd accept a PR that changes the type to string|null.

@peter-gribanov
Copy link
Contributor Author

@ondrejmirtes please review

@ondrejmirtes ondrejmirtes merged commit 912e66b into phpstan:master Oct 21, 2020
@ondrejmirtes
Copy link
Member

Thank you!

@peter-gribanov peter-gribanov deleted the setlocale branch October 21, 2020 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants