Run PHP 8.4 online
PHP 8.4 brought one of the biggest object-model upgrades in years. You can run it right now in your browser — no install, no server, nothing uploaded. Open the playground, select 8.4, and Run. php.onl executes an official WebAssembly build, so the behaviour matches real PHP 8.4.
What's new in PHP 8.4
- Property hooks — define
getandsetlogic directly on a property, replacing boilerplate getter/setter methods:public string $name { get => ucfirst($this->_name); set => $this->_name = $value; }. - Asymmetric visibility — make a property publicly readable but only privately writable with
public private(set) string $id;. array_find(),array_any(),array_all()— first-class helpers for searching arrays without writing loops.- The
#[\Deprecated]attribute — mark your own functions and methods as deprecated so callers get a proper engine warning. - Lazy objects — defer expensive object initialization until a property is actually accessed, useful for ORMs and dependency injection.
- A new HTML5 DOM API —
Dom\HTMLDocumentparses modern HTML correctly, alongside the existing DOM extension. mb_trim(),mb_ltrim(),mb_rtrim()— multibyte-aware trimming.
Try it in seconds
Paste this into the playground with 8.4 selected:
<?php
class Temperature {
public function __construct(private float $c) {}
public float $fahrenheit {
get => $this->c * 9 / 5 + 32;
}
}
echo (new Temperature(25))->fahrenheit, PHP_EOL; // 77
Compare 8.4 with other releases
Property hooks and asymmetric visibility are 8.4 features — running the snippet above on 8.3 will surface a parse error. That contrast is exactly what php.onl makes easy: select 8.4 next to 8.5 or 8.3, run once, and compare the outputs side by side. Browse every release on the versions page.
Why run PHP 8.4 here
- Private — code runs locally via WebAssembly and is never transmitted.
- Offline — the 8.4 runtime is cached after first load.
- No signup — just open and run.