3v4l.org

run code in 300+ PHP versions simultaneously
<?php enum Status { const BORING_CONSTANT = 'test'; const ENUM_VALUE = Status::PUBLISHED; case DRAFT; case PUBLISHED; case ARCHIVED; } $reflection = new ReflectionEnum('Status'); foreach ($reflection->getReflectionConstants() as $const) { if ($const->isEnumCase()) { var_dump($const); } }
Output for git.master, git.master_jit
object(ReflectionClassConstant)#4 (2) { ["name"]=> string(5) "DRAFT" ["class"]=> string(6) "Status" } object(ReflectionClassConstant)#5 (2) { ["name"]=> string(9) "PUBLISHED" ["class"]=> string(6) "Status" } object(ReflectionClassConstant)#6 (2) { ["name"]=> string(8) "ARCHIVED" ["class"]=> string(6) "Status" }

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