Connecting Tech Pros Worldwide Help | Site Map

Structs and sets

  #1  
Old July 17th, 2005, 05:20 AM
Der Andere
Guest
 
Posts: n/a
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, 05:20 AM
Karl Heinz Marbaise
Guest
 
Posts: n/a

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, 05:21 AM
lawrence
Guest
 
Posts: n/a

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, 05:21 AM
Nikolai Chuvakhin
Guest
 
Posts: n/a

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, 05:21 AM
Der Andere
Guest
 
Posts: n/a

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sorting Arrays and Structs aemado answers 7 September 9th, 2007 05:25 PM
Style question, structs and objects Inso Reiges answers 4 June 6th, 2007 04:05 PM
C++ memory loss (particularly lists of structs) foolish answers 3 May 18th, 2007 02:44 AM
Structs Jasper Kent answers 19 November 16th, 2005 03:57 AM