Closed CMCDragonkai closed 10 years ago
You're right, this lib doesn't override any PHP function. What this article says is true, mbstring overloading is a nightmare. You have several possibilities to work around if you want to make your own code work under such condition:
I read on the Readme that:
This library does not overload the standard string functions right? I also read on some posts on StackOverflow that overloading the string functions may have bad consequences when using third party libraries that use the string functions for binary operations and hence expect the normal string functions. http://evertpot.com/mbstring-function-overloading-dont-use-it/
If that's the case, let's assume I'm building a library that is intended to be used with other projects that will do some string manipulation. It's purpose is not string manipulation and hence I don't want to force an extension like mb_string.
How should I go about using functions like
strlen()
? Should I test for if the functionmb_strlen()
exists, and use it, or if it doesn't exist, use the basicstrlen()
?