Strange the first replace looks like something intentional not just a typo. If it's wrong whole `replace` call needs to be removed not just the `\`.
btw have you created pr for this on php.js too?