Now I don't know PHP or how exactly it fits into HTML, but I had an idea that you could run a PHP script in a Stack Snippet. Is this true, and if so could you give some examples?
2 Answers
\$\begingroup\$
\$\endgroup\$
3
This is impossible. PHP is server-side, but snippets are client-side.
-
5\$\begingroup\$ You could theoretically add support for server-side snippets, but I don't even want to think about that security disaster. \$\endgroup\$– orlpCommented Aug 26, 2015 at 9:00
-
\$\begingroup\$ There are services like repl.it that support languages like PHP, so I assume it wouldn't be impossible to make it secure. \$\endgroup\$ Commented Aug 26, 2015 at 9:04
-
2\$\begingroup\$ repl.it tends to disable entire imports or groups of functions, (maybe for security?). One example is you cannot
import json
in Python. \$\endgroup\$– mbomb007Commented Aug 26, 2015 at 21:55
\$\begingroup\$
\$\endgroup\$
Perhaps, if somebody added a PHP-to-Javascript converter like the other converters shown here, it could be possible. It would most likely be only a partial solution capable of only a subset of PHP's features, if ever implemented, since some wouldn't be possible.