Connecting Tech Pros Worldwide Help | Site Map

Structs and sets

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 17th, 2005, 04:20 AM
Der Andere
Guest
 
Posts: n/a
Default Structs and sets

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



  #2  
Old July 17th, 2005, 04:20 AM
Karl Heinz Marbaise
Guest
 
Posts: n/a
Default 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

  #3  
Old July 17th, 2005, 04:21 AM
lawrence
Guest
 
Posts: n/a
Default 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.
  #4  
Old July 17th, 2005, 04:21 AM
Nikolai Chuvakhin
Guest
 
Posts: n/a
Default 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
  #5  
Old July 17th, 2005, 04:21 AM
Der Andere
Guest
 
Posts: n/a
Default 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


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.