There is some overhead in development mode, but it should not make much difference. str_stri is in fact very slow, as far as I can see in the source code. Your function is much faster. I don't see at a first glance why str_stri is coded this way, maybe it's due to some special case handling. As long as you don't use unicode or some STRING specific stuff I recommend that you continue with your own function.