PHP

PHP Code Screenshot Generator

Turn PHP snippets into images worth sharing, without leaving your Mac.

Modern PHP looks nothing like the PHP most people picture, which is a good reason to post it as an image rather than describe it.

Codeshot detects PHP from the code you paste, so there is no language picker to get wrong. Here is the same snippet in three of the 30 themes it ships with, rendered with the app's own stylesheets.

<?php

final class Snapshot
{
    public function __construct(
        private string $code,
        private string $theme = 'xcode',
    ) {}

    public function export(string $path, int $scale = 2): bool
    {
        return Renderer::render($this->code, $this->theme)->save($path, $scale);
    }
}
Atom One · dark
<?php

final class Snapshot
{
    public function __construct(
        private string $code,
        private string $theme = 'xcode',
    ) {}

    public function export(string $path, int $scale = 2): bool
    {
        return Renderer::render($this->code, $this->theme)->save($path, $scale);
    }
}
Edge · dark
<?php

final class Snapshot
{
    public function __construct(
        private string $code,
        private string $theme = 'xcode',
    ) {}

    public function export(string $path, int $scale = 2): bool
    {
        return Renderer::render($this->code, $this->theme)->save($path, $scale);
    }
}
GitHub · dark

Choosing a theme for PHP

Typed properties and constructor promotion make for compact snippets. Keep the opening tag in frame so the language is unambiguous.

Getting the size right

Let the image follow your content, or lock it to a ratio — 1:1, 4:3, 3:2, 16:9, 9:16, 2:3, or 3:4 — then export at 1×, 2×, or 3× so it stays sharp on a retina display. Copy it straight to the clipboard with C, or save with S.

See all 30 themes side by side, or read the full workflow.

Built for PHP, and 59 other languages

Everything runs on your Mac. Your code never leaves it.

Download for macOS