Spent time troubleshooting and resolved it
Why would you remove valid code? Of course it will break.
Understood but why would it work in Chrome as is and not in other browsers?
Chrome is unable to interpret PHP code, just like Firefox or any other browser.