PHP 8.5.0 Beta 1 available for testing

Voting

: max(three, four)?
(Example: nine)

The Note You're Voting On

avishkasenanayake at hotmail dot com
2 years ago
If anyone is here wondering how to get all the names from the enum cases and map them into an array, it can be done like this:

array_column(CampaignPeriods::cases(), 'name');

Likewise, have the 2nd argument as 'value' to get the enum's values.

Happy coding, web artisan :)

<< Back to user notes page

To Top