1. Go to this page and download the library: Download buuum/phenum library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
buuum / phenum example snippets
final class UserEnum extends \PhEnum\PhEnum
{
const SEX_MALE = 1;
const SEX_FEMALE = 2;
}
$enum = new UserEnum(UserEnum::SEX_MALE);
$enum_female = new UserEnum(UserEnum::SEX_FEMALE);
$enum->equals($enum_female); // (false)
$enum->getValue(); // (1)
$enum->getKey(); // (SEX_MALE)