The second one does make more sense logically. If you fail to match, $matches would still have one item of nothing within it (at least I think it does), so you would end up iterating once with a non-functional result. The problem with it is that you would replace any instance of "" with whatever the content is (which is no replacement because you cannot match to anything but empty).
Although if you are planning on replacing anyway, you may as well skip the preg_match and just use a preg_replace. Using the 'e' modifier will let you write code that can be called with eval to replace at runtime what the variables of a backreference would be.
BTW, if a pattern fails to compile it will issue an E_WARNING. I'm not sure why the API doesn't specify this, although the return result doesn't guarantee that it will raise this as the length versus the offset isn't an actual error.