3v4l.org

run code in 300+ PHP versions simultaneously
<?php enum e: string { case A = 1; case B = 2; case C = 3; } print_r(e::cases()); print_r(array_column(e::cases(), 'value')); /** Array ( [0] => 1 [1] => 2 [2] => 3 ) */ print_r(array_column(e::cases(), 'name')); /** Array ( [0] => A [1] => B [2] => C ) */ ?>
Output for rfc.property-hooks, git.master_jit, git.master
Array ( [0] => e Enum:string ( [name] => A [value] => 1 ) [1] => e Enum:string ( [name] => B [value] => 2 ) [2] => e Enum:string ( [name] => C [value] => 3 ) ) Array ( [0] => 1 [1] => 2 [2] => 3 ) Array ( [0] => A [1] => B [2] => C )

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:
56.69 ms | 2748 KiB | 4 Q