@fabpot the benchmark was just an example. I don't need a benchmark to tell me that strpos is faster in a lot of cases than substr, I just need to think how I would implement strpos in C and i know that is fast, except in case that the string searching is huge, or there are a lot of substring on the string starting in HT_. Example of implementation of strstr on C: ftp://ftp.pku.edu.cn/open/UCL/tcl-8.0/compat/strstr.c I could spent time doing benchmarks on real-world apps, and I do it but in things that require it, simple things thinking is enough most of the times.

My comment was not to raise a debate between substr vs strpos, is a micro optimization and I don't care enough about it. I commented because as @pborreli said I noticed that strpos is largely used on Symfony code base. And this pull request is called "A few optimizations" and switch strpos with substr doesn't bring any optimization.