Get "PHP 8 in a Nuthshell" (Now with PHP 8.4)
Amit Merchant

Amit Merchant

A blog on PHP, JavaScript, and more

An open-source desktop playground for PHP

PHP is one of the most popular programming languages in the world. It’s been around for a long time and has a huge community of developers. It’s used for everything from simple websites to complex web applications. If you’re learning PHP, you need a good development environment to practice.

While there are many good online playgrounds for PHP like this and this, and you can also use the good old CLI to run your PHP code, there’s nothing like having a dedicated desktop playground for PHP. Sure, there are apps like Tinkerwell but that’s a paid app and not everyone can afford it.

And that’s where this new free and open-source desktop playground for PHP comes in that I recently stumbled upon. It’s called TweakPHP. It’s an Electron-based desktop application that lets you write and run PHP code right on your desktop.

TweakPHP

The user interface is pretty sleek and minimalistic. You have a code editor on the left where you can write your PHP code and a console on the right where you can see the output of your code. You can run your code by clicking the “Run” button or by pressing Cmd/Ctrl + R.

You also get autocompletion and syntax highlighting, which is always nice. There are a handful of editor themes to choose from as well. You can also open an existing PHP project by clicking the “Open” button in the left sidebar.

The only prerequisite here is you should have PHP already installed on your system since you need to give the path to the PHP executable in the settings. Once you’ve done that, you’re good to go. Also, for now, you’ll be only able to run up to PHP 8.2.

Tip: You can get the path to the PHP executable by running which php in your terminal.

The application is still in beta so the features are pretty limited and you might encounter a few bugs here and there as well. But it’s great for the starters and I believe it will only get better with time with more features and improvements and support of the great PHP community.

→ Try TweakPHP

Learn the fundamentals of PHP 8 (including 8.1, 8.2, 8.3, and 8.4), the latest version of PHP, and how to use it today with my new book PHP 8 in a Nutshell. It's a no-fluff and easy-to-digest guide to the latest features and nitty-gritty details of PHP 8. So, if you're looking for a quick and easy way to PHP 8, this is the book for you.

Like this article?

Buy me a coffee

👋 Hi there! I'm Amit. I write articles about all things web development. You can become a sponsor on my blog to help me continue my writing journey and get your brand in front of thousands of eyes.

Comments?