3v4l.org

run code in 300+ PHP versions simultaneously
<?php enum Status: int { case New = 0; case Pending = 1; } abstract class HistoryRecord { protected function __construct(public readonly Status $status) { } } class NewHistoryRecord extends HistoryRecord { public function __construct() { parent::__construct(Status::New); } } $nhr = new NewHistoryRecord(); var_dump($nhr);
Output for git.master_jit, git.master
object(NewHistoryRecord)#1 (1) { ["status"]=> enum(Status::New) }

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
52.69 ms | 956 KiB | 4 Q