Header image in document page



Main technologies and services used by PhpFiddle


PhpFiddle logo download


FhpFiddle © 2015 • English (US)

PhpFiddle Overview

PhpFiddle provides Web IDE, Web Tools, APIs, Widgets, PHP Libraries, programming resources and execution environment for PHP/MySQL/SQLite, HTML/CSS and JavaScript coding online

PhpFiddle allows people to test PHP code snippets, create, execute and download web applications, for example, Zend Framework 2 projects

Current PhpFiddle version is 3.3.1

The services provided by PhpFiddle

Application entrances

PhpFiddle provides following application entries to execute from address column of browsers

In description "code_id" is a public link id which saved the code on PhpFiddle or a gist id which saved the code on github:gist ( https://gist.github.com/phpfiddle ) by PhpFiddle, link id is made up of '-' and 6 or 8 characters in lowercase, for example, dfi-q1d, ze5q-kpb9, and gist id is string in 7, 20 or 32 characters defined by GitHub Gist, for example: 3691666, ec165a789941a37e51d8, 271254139b39bf0435895a6eea3f5b5f

PhpFiddle advocates concise and elegant URL format, you do not have to add 'www.' to our domain when you visit PhpFiddle


PhpFiddle Main




PhpFiddle Lite





All "&" and "#" in "the_url_you_want_to_open_page_code" and "the_code_you_want_to_open_on_the_editor" have to be replaced with URL encoded characters "%26" and "%23" respectively, if existed

Specific characters '\t' for tab indent, '\n' for new lne, and '\r' for carriage return are valid in the_code_you_want_to_open_on_the_editor, for example,

<!-- The code from URL -->\n\n
<script type="text/javascript">\n
\tdocument.write("Hello " + "World!" + "<br/>");\n
<strong>Hello World!</strong><br />\n\n
<div style="color: %23ff0000">Hello World!</div>\n\n
\techo 'Hello ', 'World!' , '<br/>';\n\n\n

URL should be kept no more than 2,000 characters ( About 6 times of previous URL ) because URL over 2,000 characters will not work in the most popular web browser

This URL can be generated by feature "Export / Get code URL" on Editor tab page for edited code


PhpFiddle CliRun





PhpFiddle Mobile





Gets raw contents from code_id



Gets code description from code_id



Gets raw contents from URL


All "&" and "#" in "the_url_you_want_to_get_contents" and "CSS_selector" have to be replaced with URL encoded characters "%26" and "%23" respectively, if existed


PhpFiddle widgets - Run PHP/MySQL, HTML/CSS and JavaScript code



PhpFiddle widgets - Search code from PhpFiddle code repository



PhpFiddle widgets - Encode-decode



PhpFiddle Execution Environment entrances




PhpFiddle APIs Documentation



PhpFiddle Documentation



Code editor features

Syntax highlight, code indent, new line keeps level, tab support, bracket matching, line numbers, search and replace, undo/redo, PHP and Javascript autocomplete, range collapsing and etc.

PHP error and exception handling

PhpFiddle can catch all PHP errors thay include fatal run-time error( E_ERROR ), fatal errors at initial startup( E_CORE_ERROR ), fatal compile-time errors( E_COMPILE_ERROR ), and PhpFiddle would print out error messages when code errors are catched

APIs with JSON HTTP response

APIs with JSON HTTP response support W3C recommends XMLHttpRequest specification: Cross-Origin Resource Sharing, which defines a mechanism to enable client-side cross-origin requests, APIs with JSON HTTP response makes PhpFiddle available as a server for all Ajax requests without same-origin policy limitations, any users can use these API to run the code for tutorials, articles and technical blogs on themselves web pages and getting execution results from PhpFiddle

PhpFiddle CliRun and PhpFiddle Mobile are two application samples of this kind of APIs


Execution environment libraries

Execution environment libraries are default libraries on PhpFiddle's execution environment, signed-in users can get sample usages of libraries from samples directory on PhpFiddle execution environment


PHP-MySQL Access

PhpFiddle provides PHP mysql, mysqli and pdo_mysql for all users, MySQL user permissions are:

Create, Alter and Index table, Create view, and Select, Insert, Update, Delete table data

MySQL connection infomation are:

host: "localhost", port: "3306", database: "xfiddlec_max",
user: "xfiddlec_user", pass word: "public"

DSN: "mysql:host=localhost;dbname=xfiddlec_max;port=3306"

PhpFiddle puts these information in public_db_info.php,following will add it to your code: require "util/public_db_info.php";


PHP-SQLite Access

PhpFiddle provides SQLite3, PDO for SQLite3 for all users

Users can use phpLiteAdmin to administrate SQLite database. there is no usernames and passwords required for a SQLite database


Features for logged in users

To save code to PhpFiddle, github:gist and code execution environment

PhpFiddle grant every signed-in users a unique directory to read, write and update files from it directly

To create subfolder in user id folder

To download user-id folder as an ZIP file

Transparent execution environment libraries and samples

There is no CAPTCHA required for operations: Save code, Export code and Contact PhpFiddle

All saved code by user self would be listed on 'MyLinks' window, and color code in private to distinct from code in public

To save code to github:gist and update the code saved on github:gist

To list, add, update, delete and refresh key-values with 'key-value admin'

To acceess key-value storage services with key-value stoage APIs

A lot of other features are for logged-in user only


Environmental requirements to use PhpFiddle

Screen resolution of PhpFiddle Main: 900 x 640 and up

Screen resolution of PhpFiddle CliRun: 900 x 360 and up

Screen resolution of PhpFiddle Lite: 640 x 360 and up

Screen resolution of PhpFiddle Mobile: 320 x 360 and up

Enabling pop-up window and cookies in browser

We encourages using browser Chrome and FireFox, some version IE may have problems to run PhpFiddle

Main technologies and services used by PhpFiddle

PHP5, JavaScript, jQuery, jQuery UI, CSS, HTML

Apache, Linux, MySQL, SQLite

CodeMirror, Securimage, CodeIgniter

github:gist, Facebook, Google Analytics

Other JavaScript and PHP libraries


Terms of PhpFiddle.org service


About PhpFiddle documentation

Phpfiddle documentation is in separated pages from PhpFiddle home for performance improvement