![]() You can't run every example as the sandbox you are given isn't a complete environment, but it will run standard PHP code without any issues. This can solve an issue on some sites where PHP examples are present, but there is no way to run them. If you click the "Run" button on the right you can see the result in the output window. All I did was to ensure the package was included as a dependency and then start writing code. The example below if using the iframe embed option (although I had to tweak some of the variables to get it to work correctly).īy running the above code you can see the evolution engine I have been working on (and am currently writing some articles about). It does have access to Sqlite database so it's possible to plug your applications into a data source.Įach notebook supports a few different mechanisms to allow them to be embedded. What PHPSandbox doesn't come with is PHP extensions like the GD2 library, which means you are unable to generate image files. For a beginner this shouldn't be a problem, I just couldn't accept the risk here. I think this is how GitHub permissions work though, and not a problem with PHPSandbox. ![]() I wasn't able to get this working as the permissions created would allow the site any access to any repo I have access to, which includes a few private repositories belonging to companies. ![]() It is also possible to link PHPSandbox to your GitHub account to allow code to be pulled directly from GitHub into notebooks. If your application outgrows the site then you can always download it and work on it from there. Once set up you will have a fully functioning PHP environment that you can develop simple applications with included composer dependencies. Each application you create is called a notebook and can be shared or downloaded easily. PHPSandbox also gives you the ability to create applications from skeleton examples using frameworks like Symfony and Slim. You can define the normal things you need for a PHP application like environment variables and composer packages. It allows you to create PHP projects that you can then execute to see the output using PHP 7.4 or 8.0 (at time of writing). Languages like JavaScript have a lower barrier as all you need is a web browser and a text editor and there are multiple sites out there that allow you to write and run JavaScript in the browser. You could argue that running some apt-get scripts or docker containers is easy, but that is technically a barrier to entry. PHP is very easy to learn, it's a versatile and forgiving language, but it's not exactly easy to get up and running for beginners. This includes using composer to inject dependencies into the application and a nice little editor interface to see the output and logs from the application. Recently, I found a site called PHPSandbox that allows users to create PHP applications that can be run in the same way as applications on CodePen. ![]() I have used to test small scripts using different versions of PHP, but it doesn't allow dependencies to be added and doesn't have a nice editing interface. I use sites like CodePen and JSFiddle all the time to write JavaScript and CSS, but I've not seen a similar site for writing PHP applications.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |