PHP has two (count them – 2) datatypes:
A single scalar value stored as a piece of text which is be converted to a number or boolean in an arithmetic or logical context where possible.
The second structure is a hash (not an Array!) which is keyed by scalar text. If the key is a numeric value then the hash behaves very much like an array, but if it's a text value it behaves more like a classic perl hash.
You can 'fake' an enum using an inverted hash/array structure:
$pretend_enum = array ( 'cent' => 1, 'nickel' => 2, 'dime' => 3 );
if ($pretend_enum[$value]) {
$encoded = $pretend_enum[$value];
} else {
echo "$value is not a valid coin";
}
"Structures" are usually faked by having a hash with named members:
$ceedee = array('title' => "Making Movies", 'artist' => "Dire Straights", 'tracks' => 12);
echo "My favourite CD is " . $ceedee['title'];