A great way to implement enums in PHP is to use the :: operator. For instance, if I had a class FormField, with a member variable $Type, I could implement this structure:

/* Enum for FormFieldType */
class FormFieldType {
var $Textbox = 0;
var $Password = 1;
// and so on...
}

class FormField {
var $Type; // expects FormFieldType
// More properties and functions
// Constructor
function FormField( $fft ) {
$this->Type = $fft;
}
function ToString() {
$sHTML = '';
switch ($this->Type) {
case: FormFieldType::Textbox:
//implement Textbox HTML...
break;
case: FormFieldType::Password:
//implement Password HTML...
break;
}
return $sHTML;
}
}

/* usage */
$oField =& new FormField(FormFieldType::Textbox);
$oField->ToString();
----
Manual Page -- [url]http://www.php.net/manual/en/keyword.paamayim-nekudotayim.php[/url]
Edit Note -- [url]http://master.php.net/manage/user-notes.php?action=edit+33977[/url]
Delete Note -- [url]http://master.php.net/manage/user-notes.php?action=delete+33977&report=yes[/url]
Reject Note -- [url]http://master.php.net/manage/user-notes.php?action=reject+33977&report=yes[/url]