Re:PHP 3.0 Final is out (1998)
by bruce343434 on Sunday May 23, 2021 @05:27AM
(#27253608)
What should php do then? What's the alternative language that handles this better?
[ Parent
| on HN ]
Re:PHP 3.0 Final is out (1998)
by tannhaeuser on Sunday May 23, 2021 @06:36AM
(#27253981)
For traditional PHP apps wishing to continue SSR and server-side templating, integrate HTML-aware templating (PHP has always been half there considering embedded PHP is using SGML processing instructions; it "just" needs to offer additional, more sophisticated, injection-free SGML entity-based mechanisms).
For highly dynamical apps, consider porting to JavaScript on the client side, and use PHP only as a service backend language. That's what I understand newer PHP frameworks are doing; but this will only be attractive for migrating legacy PHP apps rather than bring new users.
Re:PHP 3.0 Final is out (1998)
by bruce343434 on Sunday May 23, 2021 @04:49PM
(#27258473)
I don't see the upside to the effort of porting to js. You still have all of the same pittfalls. Yes, you can build a DOM with 20x the code and 1/20th the performance ... or you can just call htmlspeciachars() in php. Yup, security is tedious and you need to stay on your toes.