A desktop PHP playground for rapid prototyping, experimentation, and learning
phpTinker is a powerful desktop application that provides an instant PHP playground environment. Write and execute PHP code with immediate results, experiment with Composer packages, and prototype ideas without leaving your desktop.
phpTinker is a desktop code playground and prototyping tool for PHP developers. Whether you're learning PHP, testing algorithms, prototyping features, or experimenting with Composer packages, phpTinker provides a seamless coding experience right on your desktop.
Perfect for:
- 🚀 Rapid prototyping and experimentation
- 📚 Learning PHP
- 🧪 Testing code snippets and algorithms
- 📦 Trying out Composer packages
- 🐛 Debugging and troubleshooting code
- 💡 Building proof-of-concepts
-
🔵 Monaco Editor Integration: Powered by the same code editor used in VS Code
- Syntax highlighting for PHP
- IntelliSense autocomplete and code suggestions
- Error detection and inline diagnostics
- Code formatting and refactoring support
-
⚡ Instant Execution: Run PHP code with immediate results
- Auto-run mode executes code as you type (enabled by default)
- Manual execution with Run button or
Ctrl+Entershortcut - Real-time console output and error reporting
-
📦 Composer Package Management:
- Install Composer packages directly from within the app
- No need to set up separate PHP projects
- Automatically resolves and loads installed packages via autoload
-
💾 Code Snippets Library:
- Save frequently used code snippets
- Organize and manage your code collection
- Quick access to your saved snippets
-
🎨 Modern UI:
- Two-pane layout: editor on left, output on right
- Dark theme optimized for coding
- Resizable panels for comfortable workflow
- Multiple tabs for working on different files
-
✨ Advanced Features:
- Magic comments for inline value display (
// $variable) - Auto-logging: Standalone expressions automatically output their values (e.g.,
$formatted;will display the value) - Customizable settings and preferences
- Magic comments for inline value display (
- PHP (version 7.4 or higher)
- Composer (for package management)
- Node.js (v16 or higher) - for building the Electron app
- npm
- Linux, Windows, or macOS (depending on your target platform)
-
Clone or download this repository
-
Install dependencies:
npm install
-
Run the application:
npm start
phpTinker supports building for multiple platforms. To build for a specific platform:
On Linux:
npm run buildThis will create an AppImage and a .deb package in the dist/ directory.
On Windows:
npm run buildThis will create an .exe installer and portable version in the dist/ directory.
On macOS:
npm run buildThis will create a .dmg and .zip file in the dist/ directory.
Note: Electron apps require building on each target platform. Linux builds are ready to use, while Windows and macOS users can build from source.
Important: PHP (version 7.4 or higher) must be installed on your system for code execution. phpTinker requires PHP to run user code, as it spawns PHP processes for execution.
Download PHP from php.net or install via your system's package manager.
Composer is also required for package management. Install it from getcomposer.org.
- Quickly test PHP snippets without creating a new project
- Experiment with new PHP features and APIs
- Test Composer packages before integrating into projects
- Debug and troubleshoot code logic
- Prototype features before implementation
- Practice PHP syntax
- Learn by experimenting with live code
- Understand how PHP works
- Test algorithms and data structures
- Get instant feedback on code execution
- Demonstrate PHP concepts interactively
- Create shareable code examples
- Teach PHP with immediate results
- Showcase Composer packages and libraries
Here's a simple example to get you started:
<?php
// Welcome to phpTinker!
echo "Hello, World!\n";
// Magic comments show values inline
$numbers = [1, 2, 3, 4, 5]; // $numbers
// Use echo or print for output
echo "Sum: " . array_sum($numbers) . "\n";
// Or just write the variable/expression - it will auto-output!
$numbers; // Automatically displays the array
// Install Composer packages and use them
// require 'vendor/autoload.php';
// $collection = collect($numbers)->map(fn($n) => $n * 2);If you want to contribute or build for other platforms:
# Clone the repository
git clone https://github.com/boadusamuel/phpTinker.git
cd phpTinker
# Install dependencies
npm install
# Run in development mode
npm start
# Build for production
npm run buildContributions are welcome! Whether it's:
- 🐛 Bug reports
- 💡 Feature suggestions
- 📝 Documentation improvements
- 🔧 Code contributions
Feel free to open an issue or submit a pull request on GitHub.
- Built with Electron
- Uses Monaco Editor (the editor powering VS Code)
- This project was vibe coded using AI assistance 🤖✨
MIT