Esempio n. 1
0
abstract class DNSRecordType extends Enum
{
}
class A extends DNSRecordType
{
}
class CNAME extends DNSRecordType
{
}
class MX extends DNSRecordType
{
}
class NS extends DNSRecordType
{
}
class SRV extends DNSRecordType
{
}
class TXT extends DNSRecordType
{
}
class AAAA extends DNSRecordType
{
}
class PTR extends DNSRecordType
{
}
echo "DNSRecordType:\n";
foreach (Enum::iterator("DNSRecordType") as $member) {
    echo "\t" . $member . " has value " . Enum::get($member) . "\n";
}
Esempio n. 2
0
class APRIL extends Months
{
}
class MAY extends Months
{
}
class JUNE extends Months
{
}
class JULY extends Months
{
}
class AUGUST extends Months
{
}
class SEPTEMBER extends Months
{
}
class OCTOBER extends Months
{
}
class NOVEMBER extends Months
{
}
class DECEMBER extends Months
{
}
echo "Months of the year:\n";
foreach (Enum::iterator("Months") as $member) {
    echo "\t" . $member . " has value " . Enum::get($member) . "\n";
}