I saw that PHP doesn't have an enum function so I created my own. It's not necessary, but can come in handy from time to time.
<?php
function enum()
{
$args = func_get_args();
foreach($args as $key=>$arg)
{
if(defined($arg))
{
die('Redefinition of defined constant ' . $arg);
}
define($arg, $key);
}
}
enum('ONE','TWO','THREE');
echo ONE, ' ', TWO, ' ', THREE;
?>