Chances are, they're having to loop the regular expression because it's only catching the outermost instance. So if, for instance, you had (and the regex replaced the tags with square-bracketed versions):

As was stated previously, the allocated memory is never released; they are not objects in PHP -- they are just dynamically named global functions -- so they don't have scope and are not subject to garbage collection.

I agree it's not automation making PHP bad as much as some kind of demonic influence to always do the worst possible thing.