PHP code example of gusarov112 / php-enum
1. Go to this page and download the library: Download gusarov112/php-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/ */
gusarov112 / php-enum example snippets
use Gusarov112\Enum\Enum;
/**
* Action enum
*/
class Action extends Enum
{
private const VIEW = 'view';
private const EDIT = 'edit';
}
$action = new Action(Action::VIEW);
function setAction(Action $action) {
// ...
}
bash
composer