I know it /is/ possible to write tidy PHP, but to avoid the ancient kludges requires more self-discipline than most PHP programmers possess
It's not helped by the search engines turning up bad examples for people to follow, including one recently that recommended encrypting credit card details using PHP's base64_encode() function!
The page has been pulled now, but I saved a copy ...