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?

share

2 Answers 2

up vote 9 down vote accepted

This is impossible. PHP is server-side, but snippets are client-side.

share
4  
You could theoretically add support for server-side snippets, but I don't even want to think about that security disaster. –  orlp Aug 26 at 9:00
    
There are services like repl.it that support languages like PHP, so I assume it wouldn't be impossible to make it secure. –  Pietu1998 Aug 26 at 9:04
2  
repl.it tends to disable entire imports or groups of functions, (maybe for security?). One example is you cannot import json in Python. –  mbomb007 Aug 26 at 21:55

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.

share

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .