1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

PHP OOP (how often you use it?)

Discussion in 'PHP' started by tdd1984, Mar 27, 2008.

  1. Gordaen

    Gordaen Peon

    Messages:
    277
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #21
    Not going in the direction of high level programming? PHP5 has type hinting. I'm not sure what you mean by variable types, but obviously PHP has types of variables; it just has weak typing. PHP6 is probably going to have full unicode support, namespaces, etc....
     
    Gordaen, Mar 30, 2008 IP
  2. tdd1984

    tdd1984 Well-Known Member

    Messages:
    2,356
    Likes Received:
    42
    Best Answers:
    0
    Trophy Points:
    150
    #22
    Very true php has had type variables for ever and numerous other things :) I think the biggest change php has made here recently is the OOP :)
     
    tdd1984, Mar 30, 2008 IP
  3. Farhan5

    Farhan5 Peon

    Messages:
    189
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #23
    in my thinking php can be more easy...LOLZ
     
    Farhan5, Mar 31, 2008 IP
  4. Morishani

    Morishani Peon

    Messages:
    239
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #24
    Well what I mean is :

    int $iNum;
    
    Code (markup):
    And all this stuff, PHP has made a long way into OOP and that's good, but the founders don't want to make PHP like all the other languagues.
     
    Morishani, Mar 31, 2008 IP
  5. nation-x

    nation-x Peon

    Messages:
    59
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #25
    for small fast scripts I don't use OOP but for larger projects I always write classes.
     
    nation-x, Mar 31, 2008 IP
  6. Gordaen

    Gordaen Peon

    Messages:
    277
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #26
    Forcing you to declare types just makes the language static not automatically "better." That's useful when you're compiling the code and need to detect errors at compile time instead of runtime. If you compare PHP to Python, you'll see that they are similar in that regard (dynamically typed), but Python is a strongly typed language. PHP automatically converts among the types as needed, but you can use type hinting and type casting to accomplish exactly what you want.

    Of course the founders don't want to make it like all the other languages. PHP is easy, it works, and it is extremely well supported. It's an amazingly popular language precisely because it is NOT like the others.
     
    Gordaen, Mar 31, 2008 IP