Code becomes visible when using Args in own PHP block

I have a page with a loop where I’ve got the “Args in own PHP block” option enabled. On loading the file fresh everything is fine, but always at some point during editing other areas of the page, the php code becomes visible on the page (highlighted in yellow). Refreshing doesn’t fix this, I have to close the page and manually reopen it.