Php code checker online

PHP online

You can test PHP MySQL with PDO, and also test PHP Sodium (PHP 7.4.8 and PHP 8 Only).

To execute your code, you must copy and paste, drag and drop a PHP file or directly type in the «PHP code» online editor below, and click on «Run» button.

You can see the user guide to help you to use this php sandbox tool.

User guide

  • First, Drag and drop your PHP file or copy / paste your PHP text directly into the editor above.
  • Finally, you must click on «Run» button to display the result.
  • Click on the menu button «Save & share».
  • Choice a password to protect your share, so only you can change it.
  • Note the URL to access your share.
  • Click on the menu button «Load example» > «PDO / MySQL».
  • Click on the menu button «Load example» > «Sodium / Generate public and secret keys».
  • Click on the menu button «Load example» > «MongoDB».

PHP tester

PHP code tester is a web-based tool, it allows to test PHP code online directly in your browser. You can write, test, and run PHP code. Your code is executed on our server, it is only stored for the time to execute it.

This PHP playground can be useful to make online test to save time (deployment . ). You can also share your code, this can be useful for example when you have a problem and want to share it on a forum.

You can test different version of PHP (5.6.40, 7.4.8 and 8). Doing PHP online allows you not to have lots of versions of PHP on your computer.

Читайте также:  Javascript сложение введенных чисел

You can use the PDO module (MySQL database). If you need to test a particular module or another database, you can specify it in a comment (I will study the request).

With an online PHP editor, developers can quickly write and test code without needing to install and set up a local development environment.

Note: Some functions have been disabled for security reasons.

Choice a password to modify/delete this PHP snippet later Enter password to modify this PHP snippet. Enter password to delete this PHP snippet. Enter the new password for the fork.
Action

$keys = sodium_crypto_box_keypair(); $secretKey = sodium_crypto_box_secretkey($keys); $publicKey = sodium_crypto_box_publickey($keys); echo "Your base64 encoded public key: ".base64_encode($publicKey)."\n"; echo "Your base64 encoded secret key: ".base64_encode($secretKey)."\n";

$dsn = «mysql:host=mysql;dbname=php_tester»; $user = «php_tester»; $passwd = «password»; $pdo = new PDO($dsn, $user, $passwd); $stm = $pdo->query(«SELECT ‘1’ as id, ‘Albert’ as name UNION SELECT ‘2’ as id, ‘Isaac’ as name UNION SELECT ‘3’ as id, ‘Marie’ as name «); $rows = $stm->fetchAll(PDO::FETCH_NUM); foreach($rows as $row)

// Connect to phpTester database $manager = new MongoDB\Driver\Manager("mongodb://php-tester:123@localhost:27017/phpTester"); // Insert a document $bulkWrite=new MongoDB\Driver\BulkWrite; $doc=array("title" => "PHP Tester", "description" => "Test PHP code online"); $bulkWrite->insert($doc); $manager->executeBulkWrite('phpTester.example', $bulkWrite); // Get all documents $query = new MongoDB\Driver\Query(array()); $cursor = $manager->executeQuery('phpTester.example', $query); // Convert to Array and print result print_r($cursor->toArray()); // Delete all documents $bulkDelete = new MongoDB\Driver\BulkWrite; $bulkDelete->delete(['title' => 'PHP Tester' ], ['limit' => 0]); $manager->executeBulkWrite('phpTester.example', $bulkDelete);

Источник

PHP syntax checker

PHP error checker allows to check your PHP code syntax, and find PHP errors easily and quickly. This PHP code checker tool highlights and goes to line with a syntax error.

You can check syntax for PHP 5, PHP 7 and PHP 8 🙂

To check your code, you must copy and paste, drag and drop a PHP file or directly type in the «PHP code» online editor below, and click on «Check PHP syntax» button.

You can see the user guide to help you to use this php checker tool.

User guide

  • First, Drag and drop your PHP file or copy / paste your PHP text directly into the editor above.
  • Finally, you must click on «Check PHP syntax» button to display if there is an syntax error in your code.

PHP code checker tool

PHP is a server-side scripting language, but can also be used as a general-purpose programming language.

Читайте также:  Html css div background image

PHP error checker tool allows to find syntax errors (lint). You can test your PHP code online directly in your browser.

If a syntax error is detected, then the line in error is highlighted, and it jumps to it to save time (no need to search the line).

It can be useful to make online test to save time (deployment . ).

Note: If you want to run php code you can use our PHP Online tool.

API

An API is available to test the syntax of your php scripts.

Check the PHP syntax. PHP versions: 5.6.40, 7.4.8, 8.0.0.

const request = new XMLHttpRequest(); request.open("POST", "https://api.extendsclass.com/php-checker/8.0.0", true); request.onreadystatechange = () => < >; request.send('');

Источник

Analyse or fix PHP script online

This form help you to analyse your script code for selected coding standard (PSR2, PSR1, PSR12, Zend, Squiz, MySource, . ).
Also, you can check your source code compatibility with most recent version of PHP. The check uses the static analysis to perform audits. The exhaustivity is not guarantee without run of code in real condition on the targeted PHP version.

Submit your PHP scripts in 3 steps

Why use Coding Styles checker is needed?

The code source style helps you and other developers to read the code most easily. This php code checker and fixer online service is available free of charge.

Can I update the code style automatically?

Yes, you can (it’s recommended) run PHP CS or PHP CS Fixer on your code to apply all rules of style code. You must configure the tool before running to define the main code style between PSR 1, PSR 2, PSR 12, Symfony, PEAR, Zend or your custom rules.
You can use a GIT hook to apply only to updated files.
This php code analyzer online is available to help you to test the effect of the style code rules on your snippet code.

What is the goal of static analysis to upgrading the code?

The static analysis help the developer to check and list all necessary change in code sources.
This php compatibility checker online help you to check your codes snippets.

Читайте также:  Css half star rating

What are the tools available to execute style code analysis?

This online PHP code checker and fixer uses «PHP Code Style» (PHPCS) with some rules sets or «Phan» to analyze your code snippet. Otherwise, use «PHP CS Fixer» to analyze and patch your code snippet.

What are the tools available to upgrade the code?

This online PHP code analyzer uses «Rector» to change your snippet code. The rules selected are the default rules to upgrade code to the targeted PHP version.

The static analysis is sufficient to upgrading code to new PHP version?

No, you must run your code with the targeted PHP version to run unit tests and all other tests. The manual test is needed to complete the test.

Источник

Php code checker online

07/05/2023: Added PHP 8.3.0alpha3, 8.2.8 and 8.1.21
06/23/2023: Added PHP 8.3.0alpha2
06/22/2023: Added PHP 8.3.0alpha1
06/08/2023: Added PHP 8.0.29
06/07/2023: Added PHP 8.1.20, 8.2.7

Please let me know when you find any bugs or annoyances to help make this website better 🙂

Notes

Network access is rerouted from within the Sandbox, and system access is limited for now. Read about how to use network functions and example files.

If you feel like a function should be enabled/disabled, or if you have any other suggestions, let me know through the comments below or send me an email :).

Looking for the old version?
Check this out: The Legacy Online PHP Sandbox

Most used PHP functions

  • sandbox (118614280)
  • preg_replace (207084)
  • json_encode (146025)
  • preg_match (135289)
  • unserialize (116240)
  • serialize (111962)
  • hex2bin (101263)
  • uniqid (82524)
  • array (72629)
  • json_decode (61956)
  • iconv (54082)
  • utf8_decode (47401)
  • preg_replace_callback (47048)
  • preg_match_all (46033)
  • str_replace (42850)
  • strtotime (38886)

Last used PHP functions

  • sandbox (1 second ago)
  • htmlspecialchars_decode (9 minutes ago)
  • unserialize (12 minutes ago)
  • serialize (17 minutes ago)
  • password_hash (32 minutes ago)
  • password_verify (35 minutes ago)
  • utf8_decode (36 minutes ago)
  • rawurldecode (40 minutes ago)
  • json_encode (51 minutes ago)
  • zlib_decode (56 minutes ago)
  • array_diff (1 hour ago)
  • preg_match (1 hour ago)
  • array_diff_key (1 hour ago)
  • zlib_encode (1 hour ago)
  • implode (1 hour ago)
  • array_reverse (1 hour ago)

Источник

Оцените статью