[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [PROGRAMMERING] Enumerations i PHP



On Fri, 04 Feb 2005 14:40:46 +0100, Lars Riisgaard Ribe wrote:

> Jeg savner en funktionalitet a la:
> $b er af typen enum { 'db', 'file', 'screen' }; //b skal altså kunne
> være lig 'db', 'file', 'screen' og ikke andet.
> 
Nu har PHP principielt set ikke nogen datatyper, hvorfor enums ikke giver
mening
> og så kunne kalde f.eks.
> function send_data( $dest ) // her skal så være et check af, om $dest
> er af typen, dvs. den indeholder kun 'db', 'file' eller 'screen'.
> 
Hvad med at indkapsle det i en klasse?

function send_data ( $DestClass ) {

switch ( $DestClass->getOutput ) {
case 'db':
case 'file':
case 'screen':
}


-- 
Hilsen/Regards
Michael Rasmussen
http://keyserver.veridis.com:11371/pks/lookup?op=get&search=0xE3E80917



 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 22:44 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *