This issue is already being addressed. The simplest workaround available today is replacing all '$' characters in PHP code to '$$'. HTML template processor will convert them back to single '$' characters.

In next update, there will be an option of disabling macro expansions inside PHP blocks.