On Sat, Jul 30, 2016 at 8:06 AM, Michael Vostrikov < michael.vostri...@gmail.com> wrote:
> No! You don't understand what I'm trying to explain. We understand, that's why we're discussing so much against it. > This feature will be > useful for ALL applications without template engine - frameworks, CMS, > custom core. Not really. What you propose is `Foo::escape()` (static), as a language construct. This is a problem, as it makes the escaping statically bound to a configured endpoint, and that endpoint may even change (what the heck?!) Templating engines can instead switch the escaping per-template-file, which is much more powerful, as the assumption of context may change. This is the same as calling constructor manually after every 'new' > statement: (new User)->__construct(...), (new Profile)->__construct(...). > If any templating engine does that, I'd suggest opening an issue on their issue tracker to make their implementation non-static instead. Anyway, I saw that voting is open, and already voted "No" on it for the reasons mentioned above, and because I don't believe in adding more custom AST for something that is already working very well in userland via functions. Users that don't escape their output usually do so because they lived under a rock, and they'll continue to do so regardless. Users that know how and when to escape are already using appropriate functions for that. The proposed solution is a solution, but not for this problem, in my opinion. Greets, Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/