3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* class ReflectionEnum { public function __construct(string $name); public function getCases(): array; } class ReflectionEnumCase { public function getAttributes(): array; } trait AsScalar { public function toScalar(string $which); public static function fromScalar(string $which, $scalar): static; } enum Suit { use AsScalar; #[Scalar('db', 'h'), Scalar('json', 'hearts')] case Hearts; #[Scalar('db', 'd'), Scalar('json', 'diamonds')] case Diamonds; #[Scalar('db', 'c'), Scalar('json', 'clubs')] case Clubs; #[Scalar('db', 's'), Scalar('json', 'spades')] case Spades; } echo Suit::Hearts->toScalar('db'); // h echo Suit::Hearts->toScalar('json'); // hearts echo Suit::fromScalar('db', 'h'); // Hearts echo Suit::fromScalar('json', 'hearts'); // Hearts */
Output for git.master, git.master_jit, rfc.property-hooks

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:
36.21 ms | 401 KiB | 8 Q