Share PHP code with CodeThis
PHP powers WordPress, Laravel, and a surprising amount of the internet. Paste modern PHP 8+ with attributes and union types.
Paste PHP nowWhat you get
- PHP-aware syntax highlighting via CodeMirror
- Instant shareable link — no signup required
- Optional expiration (7 days, 30 days, permanent)
- Password protection for private pastes
- Works with the REST API and MCP server
- Rich markdown and MDC components alongside code
Common use cases for PHP pastes
- Laravel route definitions
- WordPress filter examples
- Composer package snippets
- Framework bug reports
Example
<?php
readonly class Money {
public function __construct(
public int $amount,
public string $currency = 'USD',
) {}
public function add(Money $other): Money {
return new Money($this->amount + $other->amount, $this->currency);
}
}
Related languages
Ready to share some PHP?