At some point internally, PHP converts function and class names to their lowercase equivalent. According to this page, Turkish has two forms of the letter “i”, which are apparently not interchangeable.
This all, of course, means that any function or class with a capital “i” in it’s name will appear undefined when using a Turkish locale. Fun!
The simplest workaround seems to be just setting LC_CTYPE back to en_US when using the tr_TR locale.