Structs and sets

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Der Andere

    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


  • Karl Heinz Marbaise

    #2
    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

    Comment

    • lawrence

      #3
      Re: Structs and sets

      Karl Heinz Marbaise <khmarbaise@gmx .de> wrote in message news:<c3n1a9$29 jv1n$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.

      Comment

      • Nikolai Chuvakhin

        #4
        Re: Structs and sets

        "Der Andere" <matieuloeschmi ch@gmx.net> wrote in message
        news:<c3mpug$ad n$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

        Comment

        • Der Andere

          #5
          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


          Comment

          Working...