Connecting Tech Pros Worldwide Forums | Help | Site Map

Structs and sets

Der Andere
Guest
 
Posts: n/a
#1: Jul 17 '05
Two short questions:

1. Is there any implementation of sets in PHP4?
2. Can I define structs (e.g., as in C++) or do I have to use classes
instead??

Cheers,
Matthias

--
Für emails Anweisung in der Adresse befolgen



Karl Heinz Marbaise
Guest
 
Posts: n/a
#2: Jul 17 '05

re: Structs and sets


Hi Andere,
[color=blue]
> 1. Is there any implementation of sets in PHP4?[/color]
What exaclty do you mean with Sets ?
[color=blue]
> 2. Can I define structs (e.g., as in C++) or do I have to use classes
> instead??[/color]
What is the difference between structs an classes ? Just the default
access (structs: public classes: private)
You should use classes as in C++, but you have no differences or
mechanism to distinguish between private and public elements (only
in PHP5).

Kind Regards
Karl-Heinz

--
Dipl.Ing.(FH) Karl Heinz Marbaise | www.marbaise.org
Jabba Dabba Dooh ;-) | ICQ# 135949029

lawrence
Guest
 
Posts: n/a
#3: Jul 17 '05

re: Structs and sets


Karl Heinz Marbaise <khmarbaise@gmx.de> wrote in message news:<c3n1a9$29jv1n$2@ID-68093.news.uni-berlin.de>...[color=blue]
> Hi Andere,
>[color=green]
> > 1. Is there any implementation of sets in PHP4?[/color]
> What exaclty do you mean with Sets ?[/color]

If "Sets" means Enumerations, then no, there are none in PHP. You
could maybe fake it with a class that has an array of allowed options.
Nikolai Chuvakhin
Guest
 
Posts: n/a
#4: Jul 17 '05

re: Structs and sets


"Der Andere" <matieuloeschmich@gmx.net> wrote in message
news:<c3mpug$adn$00$1@news.t-online.com>...[color=blue]
>
> 1. Is there any implementation of sets in PHP4?[/color]

No, but PHP arrays are flexible enough to emulate them.
[color=blue]
> 2. Can I define structs (e.g., as in C++)[/color]

No, but PHP arrays are flexible enough to emulate them.
[color=blue]
> or do I have to use classes instead??[/color]

You can do that, if you want...

Cheers,
NC
Der Andere
Guest
 
Posts: n/a
#5: Jul 17 '05

re: Structs and sets


> > > 1. Is there any implementation of sets in PHP4?[color=blue][color=green]
> > What exaclty do you mean with Sets ?[/color]
>
> If "Sets" means Enumerations, then no, there are none in PHP. You
> could maybe fake it with a class that has an array of allowed options.[/color]

That's what I meant.

Regards,
Matthias


Closed Thread