Hacker News new | ask | show | jobs
by goykasi 4291 days ago
PHP is simply a scripting language. It has numerous other uses besides just "mixing code in with html"; it wouldn't make sense to have something like enabled by default. For example, all console scripts would need to disable it.
1 comments

Yes, it's a general purpose language and can be used for many different things, but as its name once indicated, PHP's primary use case is preprocessing hypertext. I think it would make sense since that's what almost all the PHP in the wild is involved with. Although i'm sure escaping could also be disabled by default when running from the command line.