Hi internals Regarding the matter of a sandbox, one of my colleagues open sourced a Laravel sandbox that runs straight in the browser and uses docker containers, with a little work you can extract away the Laravel part and have it run plain PHP. Here's the source: https://github.com/spatie/tinker.app <https://github.com/spatie/tinker.app> and here's it running: https://tinker.app/ <https://tinker.app/>
On topic now, regarding the promo page: this kind of marketing is where PHP lacks a little bit, so I think it's a great initiative. A simple one pager just to promote PHP, one you can share with both PHP and non-PHP developers, and teases the right amount to get some people interested. A perfect page to share on hackernews, reddit, twitter and the likes. I think it's a great first step! Kind regards Brent > On 14 Oct 2020, at 13:18, Dik Takken <dik.tak...@gmail.com> wrote: > > On 14-10-2020 03:41, Larry Garfield wrote: >> This sounds like a fantastic idea. The inline-run capability of Go and >> Rust's documentation is a huge win. Writing good sample code for the >> documentation would be an interesting challenge, but it's the sort of thing >> that can be done over time. > > I second this. However, then we should also make sure that the example > code actually works, and on which PHP versions. As soon as examples can > be run right from the documentation pages, the examples will be run far > more frequently than they are now, simply because it is so much easier > to do. Broken examples will cause more disappointing experiences. > > I don't know if example code is currently tested automatically. If not, > adding a sandbox for running them may also offer an opportunity for > automatic testing. > > Besides experimenting with example code, a sandbox may also be used to > expose runtime information. Think of generated opcodes, the JIT compiled > assembly, the AST. > > At some point I can imagine adding a documentation page about > performance, optimization and JIT. That page could enable users to see > how an example code snippet is compiled, optimized and how type > inference is done. Change the code, change opcache settings and see what > happens. It is interesting to toy around with and it helps to get more > exposure to some impressive developments of recent years. > >> The interesting question would be how to configure it to ensure it doesn't >> become a security issue. We'd probably need to lock down the environment's >> ini settings *hard* to make sure it can't do any outgoing communication at >> all. > > Trying to lock things down will also limit the example code that can be > run. And we run the risk of overlooking things. Maybe we could learn > from other languages, how they set up their sandbox environments. > >> If we need hosting for that, I work for a hosting company and we're happy to >> help. > > I think we all highly appreciate that offer. > > Regards, > Dik Takken > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: https://www.php.net/unsub.php >