3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); enum ImageBoardDomains: string { case Dvach = 'ru'; case Sosach = 'so'; case Harkach = 'hk'; } abstract class ImageBoard { abstract public function getDomain(): string; } class Dvach extends ImageBoard { public function getDomain(): string { return ImageBoardDomains::Dvach->value; } } class Sosach extends ImageBoard { public function getDomain(): string { return ImageBoardDomains::Sosach->value; } } class Harkach extends ImageBoard { public function getDomain(): string { return ImageBoardDomains::Harkach->value; } } print_r(ImageBoardDomains::cases());
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => ImageBoardDomains Enum:string ( [name] => Dvach [value] => ru ) [1] => ImageBoardDomains Enum:string ( [name] => Sosach [value] => so ) [2] => ImageBoardDomains Enum:string ( [name] => Harkach [value] => hk ) )

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:
41.53 ms | 406 KiB | 5 Q