Hi,
I solved the problem using the "/e" flag, which makes the preg_replace() to evaluate the expresion before replacement.
Code: 
preg_replace('/\<-- ([A-Z_]+) --\>/e', "$$1", $t);