from http://uk3.php.net/strlen strlen returns null if called on an array. Is there another circumstance when strlen can return null? 

I wrote this fix a couple months ago but unless $matches[3][$index] is an array at any point I think this should be ok.

I can't find the code I used to reproduce the issue. In the next week what I will do is rewrite the code to reproduce the issue and see what the value of $matches[3][$index] is to get a feel for if it can every be an array.