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.

Which one is better , PHP5 or PHP4?

Discussion in 'PHP' started by mattcch2007, May 24, 2007.

  1. #1
    Which one is better , PHP5 or PHP4?
    any comments on it as i am planning to migrate to newer ver.:)
     
    mattcch2007, May 24, 2007 IP
  2. manilodisan

    manilodisan Peon

    Messages:
    224
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Both of them are used. PHP5 catches up pretty slow though. PHP4 is widely used on websites. If you're into learning I would recommend PHP5 which has a better aproach to OOP.
     
    manilodisan, May 24, 2007 IP
  3. coderbari

    coderbari Well-Known Member

    Messages:
    3,168
    Likes Received:
    193
    Best Answers:
    0
    Trophy Points:
    135
    #3
    there are some features in PHP5 which not available in PHP4.so it will be better if you use PHP5.
     
    coderbari, May 24, 2007 IP
  4. mattcch2007

    mattcch2007 Peon

    Messages:
    562
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    i have a solaris 10 server with tomcat5.5.20,
    using jsp mostly and now i want deeply in php
    thank for suggestion:)
     
    mattcch2007, May 25, 2007 IP
  5. raredev

    raredev Peon

    Messages:
    49
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    for me, newer is beter :D
     
    raredev, May 25, 2007 IP
  6. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #6
    I like 5 much, much more than 4. It has many more features included with it and it supports true OOP. There are some performance issues that I have heard people complaining about, but I haven't seen anything alarming enough to turn me away from it.
     
    jestep, May 25, 2007 IP
  7. projectshifter

    projectshifter Peon

    Messages:
    394
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #7
    PHP object orientated code is way way overrated. It's mostly Asian coders that I've seen that do it, generally north american and eastern european coders do not. PHP5 redid their OOP bits in their code.

    As far as PHP4 to PHP5, 5 is more becoming the standard, a lot of webhosts are still using 4. They operate almost entirely the same, you don't have to worry about which one to "learn", it's not a Microsoft product ;) PHP5 has a couple of new features that are cool, but it doesn't make a huge difference which one you use unless you're using one of the new functions, which you probably won't.
     
    projectshifter, May 25, 2007 IP
  8. Eran-s

    Eran-s Peon

    Messages:
    50
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Currently, most of the hosting company using PHP4, so I prefer you to use PHP4 until PHP5 will hit the spot...
    I'm not saying that PHP4 is better, the invert is right...
     
    Eran-s, May 25, 2007 IP
  9. azvouchers.com

    azvouchers.com Peon

    Messages:
    24
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Me too, I always like newest version.
     
    azvouchers.com, May 25, 2007 IP
  10. stugs

    stugs Peon

    Messages:
    157
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #10
    If you're developing an application, it's not usually wise to develop for the old version unless there is a good reason to hold back. Otherwise you'll just end up re-coding to support the newer version in the future.

    If PHP5 came out last week, I'd say stick with PHP4. Otherwise, go for 5.
     
    stugs, May 25, 2007 IP
  11. lwbbs

    lwbbs Well-Known Member

    Messages:
    331
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    108
    #11
    Of couse, PHP5.
    More feature than PHP4

     
    lwbbs, May 25, 2007 IP
  12. projectshifter

    projectshifter Peon

    Messages:
    394
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #12
    PHP5 came out more than a year ago I think, I've been using it pretty much forever.
     
    projectshifter, May 25, 2007 IP
  13. stugs

    stugs Peon

    Messages:
    157
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #13
    "If PHP5 came out last week, I'd say stick with PHP4. Otherwise, go for 5."

    I'm saying if it was the first week the new revision came out it doesn't make good sense to instantly going with the newer version just because it's new. Look at Windows Server 2003. If you migrated just cuz it was new and out good luck moving your Exchange 2000 domain to it because there were 100s of issues that cropped up when it came out.
     
    stugs, May 25, 2007 IP
  14. Paris Holley

    Paris Holley Peon

    Messages:
    27
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #14
    Code wise it really doesn't matter. PHP 5 introduces new functions and better OOP techniques but if you got by with in 4 or didn't develop many OOP based scripts, theres really no point. As usual, the industry is slow to adapting the new versions, and PHP 6 is just around the corner, so if you are a developer you would be cutting your clientbase in about half because many hosts do not support 5 yet..
     
    Paris Holley, May 25, 2007 IP
  15. projectshifter

    projectshifter Peon

    Messages:
    394
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #15
    PHP6 is going to be so sexy, I can't wait! But really PHP4 and PHP5 are almost 100% cross-compatible, there are only a few new functions and they really aren't that essential, so for 99.996% of all projects that use PHP, either version would suffice.
     
    projectshifter, May 26, 2007 IP
  16. streety

    streety Peon

    Messages:
    321
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #16
    Despite the announcement coming out on April 1st it would seem that support for PHP4 really is being dropped at the end of the year. It really is time people moved to PHP5.
     
    streety, May 26, 2007 IP
  17. Jem

    Jem Peon

    Messages:
    22
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #17
    I code publicly for PHP4 but my scripts are compatible with PHP5 - I don't see why others don't go that route. By factoring in multiple versions you expand your prospective audience.

    Of course, private code can be purely PHP5 because I know that I can support it.
     
    Jem, May 26, 2007 IP
  18. login

    login Notable Member

    Messages:
    8,849
    Likes Received:
    349
    Best Answers:
    0
    Trophy Points:
    280
    #18
    Why is PHP6 coming so quickly after PHP5 ?
     
    login, May 26, 2007 IP
  19. projectshifter

    projectshifter Peon

    Messages:
    394
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #19
    I don't think it's really that quickly, a couple years isn't that bad of a turnaround. PHP5 really wasn't anything that great over PHP4 other than a lot of optimizations and such. It may have a little to do with everything being multi-core or multi-processor now so PHP6 will most likely take advantage of multiple cores and operate a bit better, but for the most part there hasn't been any major changes as far as developers are concerned unless you rely heavily on object oriented code
     
    projectshifter, May 26, 2007 IP
  20. gibex

    gibex Active Member

    Messages:
    1,060
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    95
    #20
    php 4 .... :)
     
    gibex, May 26, 2007 IP