Steven Vachon

Archive of posts for March, 2012

Benchmark: PHP strlen vs. count (and sizeof)


I was writing some code that generated a string from an array and came across a pretty rare situation where I could either get the length of that array or the length of the assembled string. Wondering which was faster and finding nothing on Google, I put this benchmark together. Read more