PHP code example of jdecool / enum

1. Go to this page and download the library: Download jdecool/enum 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/ */

    

jdecool / enum example snippets


use JDecool\Enum\Enum;

class MyEnum extends Enum
{
    public const ENUM_1 = 'value_1';
    protected const ENUM_2 = 'value_2';
    private const ENUM_3 = 'value_3';
}

$value1 = MyEnum::ENUM_1();
$value2 = MyEnum::ENUM_2();
$value3 = MyEnum::ENUM_3();