The KPHP Playground is a place where you can run and edit KPHP code online.
- Attractive and simple UI
- Ability to run programs with arguments
- Ready-made examples
- Formatting the code
- Dark and light theme
- The ability to edit fonts and editor for yourself
- Contains keyboards shortcuts
If you want to learn more about KPHP, then there are several useful links in the playground for this:
- Documentation - KPHP documentation.
- GitHub - KPHP source code.
- Telegram chat - The chat where you can ask, answer or discuss various questions related to KPHP.
The KPHP Playground
supports changing the theme. You can choose a dark or light theme depending on your tastes.
In order to compile and run your program, click on the Run
button.
After launching the program, a console will appear from below.
If you want to see the compiler output, then go to the build log
in the console.
If you want to see the output of the program, go to the output
in the console.
There are several examples with comments in the KPHP Playground
that you can view and run.
To study the example, click on the Examples
button and select an example from the drop-down list.
If you suddenly messed up the example and want to restore it, then you should click the Refresh
button.
Also, KPHP Playground
supports the ability to pass arguments to the program.
To pass arguments to the program, they should be written in Run arguments
input.
The style of the code is very important, so KPHP Playground
provides an opportunity to format the code.
To do this, click on the { Format code }
button.
KPHP Playground
contains several keyboard shortcuts to increase usability.
KPHP Playground
provides the ability to configure some parameters so that it's comfortable for you to write code.
In order to go to the settings, you need to click on the gear.
- You can choose the font of the code.
- You can specify the font size and line spacing.
- It's also possible to choose a theme for the code editor.
- You can specify whether you need the line numbers to be displayed in the editor or not.
If you want to contribute to this project and engage in development , then for this you will need:
- Update your packages:
$ sudo apt-get update
- Upgrade your packages:
$ sudo apt-get upgrade
- Install PHP:
$ sudo apt-get install php
- Check:
$ php --version
- Install PHP:
$ brew install php
$ php --version
If the installation was successful, you should see something like this output:
PHP 8.0.28 (cli) (built: Feb 14 2023 15:42:52) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.28, Copyright (c) Zend Technologies
with Xdebug v3.2.1, Copyright (c) 2002-2023, by Derick Rethans
How to install KPHP, see the official documentation:
- Open the terminal and clone the repository:
$ git clone https://github.com/Tsygankov-Slava/kphp-playground.git
- Go to the project directory:
$ cd kphp-playground
- Start the local php server on port 8000 (You can choose a different port):
$ php -S localhost:8000
- Open http://localhost:8000/www/index.html in browser.
If everything went well, you should observe the main page of the project:
P.S. The code written in KPHP is interpreted by PHP without any problems.
So use a php server
for development and testing. When you have tested the code, it needs to be compiled and run on the kphp server
.
- Compile
index.php
:
$ cd /kphp-playground/server/
$ kphp index.php
- Run server:
$ cd kphp_out/
$ ./server -H 8080 -f 1 -t 420
- After starting the
kphp server
, you should go to http://localhost:8080/ and see the server page:
kphp-playground
is distributed under the MIT License, on behalf of Tsygankov Viacheslav.