This for example could be kept private if the preg_replace_callback above would call it directly instead of adding indirection via that lambda. It's called just once by the lambda so I don't quite see the benefit of the extra indirection.