Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>SnapCode - PHPNew to Visual Studio Code? Get it now.
SnapCode - PHP

SnapCode - PHP

haruncox

|
1 install
| (0) | Free
Execute PHP code and display output in a split view — with WordPress & Laravel framework detection, SQL query logging, and performance metrics.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

SnapCode - PHP

snacode-php

Instant PHP execution and performance inspector for VS Code.
Support Raw PHP, WordPress, Laravel and more

Features

  • ⚡ Smart Execution: Automatically runs selected PHP code if highlighted, or executes the entire active file.
  • 🌐 Framework Bootstrapping:
    • WordPress: Auto-detects root, loads wp-load.php, and tracks $wpdb SQL queries.
    • Laravel: Auto-detects app root, bootstraps Artisan container, and tracks Eloquent/Query Builder queries with parameter bindings.
    • Plain PHP: Isolated high-performance execution for standard scripts.
  • 🗃️ Automatic SQL Query Logging: Shows executed database queries inline with execution times, parameter bindings, and one-click copy.
  • 📊 Real-time Metrics: Displays execution duration, peak memory consumption, and query count.
  • 🖥️ Flexible Layouts: Split view (Right/Bottom) with one-click toggling, or detach into an independent window.
  • 🎨 Rich Visuals: Formatted output with syntax highlighting for data structures (var_dump, print_r, JSON), errors, and stack traces.

Keybinding

Command macOS Windows / Linux Description
SnapCode: Run PHP Cmd + Shift + Enter Ctrl + Shift + Enter Smart execute selection or active PHP file

Configuration

Search snapcode in VS Code Settings (Cmd+, / Ctrl+,):

Setting Type Default Description
snapcode.phpPath string "php" Path to PHP binary executable.
snapcode.autoDetectFramework boolean true Auto-detect WordPress and Laravel workspaces.
snapcode.outputPosition string "right" Panel split position ("right" or "bottom").
snapcode.showSQL boolean true Show SQL query logs when queries are executed.
snapcode.showMetrics boolean true Display execution metrics bar.
snapcode.timeout number 30000 PHP execution timeout in milliseconds.
snapcode.maxOutputSize number 5000 Max lines displayed in output buffer.
snapcode.theme string "auto" Panel visual theme ("auto", "dark", "light").

Commands

Available via Command Palette (Cmd+Shift+P / Ctrl+Shift+P):

  • SnapCode: Run PHP — Execute highlighted PHP selection or active file.
  • SnapCode: Open Output Panel — Open the SnapCode output view.
  • SnapCode: Clear Output — Clear the output view and metrics.
  • SnapCode: Toggle Output Panel Split Position — Switch split layout between Right and Bottom.
  • SnapCode: Separate / Re-attach Output Window — Detach output panel into a floating window.

Requirements

  • PHP 7.4+ or PHP 8.x installed and available in system PATH (or configured via snapcode.phpPath).

License

Created by haruncox.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft