The use of {PHP} tags is decripated because of security risks and a lot of other problems. For that reasion n Smarty3 the {php} tags are disabled by default and when enabled the implementation is different from that in Smarty2 which does not allow to break the PHP if statement in serveral sections.

Anyway your piece of code will run in Smarty3 template syntax without the need of {php}

These changes should allow the default debug.tpl template to work even if you change delimiters.

NOTE: It is a good idea to delete your cached/compiled templates after applying the change. I suppose you can just delete the cached/compiled debug template, if you can find it, but for me it was easier to just delete them all.