Loading…

Online PHP Compiler and Playground

Browser-based compiler and playground for PHP — Progsity IDE.

About PHP

PHP still powers much of the web—WordPress, Laravel, and countless APIs. This online PHP runner executes scripts in a CLI-style sandbox: great for practicing arrays, string functions, and small algorithms without spinning up Apache locally.

Open tags start your file; use echo or print_r for readable output. The playground separates parse errors from runtime warnings so you can tighten error reporting gradually.

Useful for backend learners in Bangladesh and abroad who want quick feedback loops before diving into frameworks.

How to use

  1. Begin with <?php and write imperative code. The default echoes Hello, World.
  2. For stdin in advanced snippets, use fgets(STDIN); paste matching input.
  3. Watch for semicolons and $variables—PHP is forgiving but not silent on fatals.

FAQ

Is PHP execution free?

Yes. Running PHP is free; saved snippets may be limited on free accounts.

Which PHP version?

A modern PHP runtime in the sandbox. Use phpversion() or PHP_VERSION to inspect.

Can I use Composer packages?

Not in this single-file playground—stick to core functions for Phase 1.

Save PHP scripts?

Yes after sign-in from the dashboard.

Compiler or playground?

PHP is interpreted at request time; you still get fast edit-run cycles like a playground.

Code examples

Tap “Try this” to load sample code into the editor above.

  • array_map

    <?php
    $nums = [1, 2, 3, 4];
    $doubled = array_map(fn($x) => $x * 2, $nums);
    print_r($doubled);
  • String helpers

    <?php
    $s = "  Progsity IDE  ";
    echo strlen(trim($s)) . "\n";
  • Foreach

    <?php
    $scores = ["a" => 90, "b" => 85];
    foreach ($scores as $k => $v) {
        echo $k . ": " . $v . "\n";
    }
  • json_encode

    <?php
    $data = ["ok" => true, "n" => 7];
    echo json_encode($data) . "\n";