Location: PHPKode > scripts > PHP Enumeration > php-enumeration/Enumeration.test.php
<?php
require 'Enumeration.class.php';

Class testEnum extends baseEnum
{
	const value1='One';
	const value2='Two';
	const value3='Three';

	// This is critical so baseEnum can get the class contants
	public function __construct()
	{
		parent::__construct(__CLASS__);
	}
}


$a = new testEnum;
$a->value = testEnum::value2;

// Displays Two
echo $a->value;
?>
Return current item: PHP Enumeration