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. Kalyse

    Kalyse Peon

    Messages:
    1,221
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    0
    #21
    I upgraded last week specifically for the new PHP5 functions. I love the new OOP functions, class autoloaders and other things.

    Go for 5.
     
    Kalyse, May 26, 2007 IP
  2. mattcch2007

    mattcch2007 Peon

    Messages:
    562
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #22

    i think it maybe siimilar to java ,having more and more oop built-in,
    is it single inheritance like java or multi-inheritance like c++?:)
     
    mattcch2007, May 27, 2007 IP
  3. Nerve

    Nerve Peon

    Messages:
    467
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #23
    I like to use PHP4.
     
    Nerve, May 27, 2007 IP
  4. Kalyse

    Kalyse Peon

    Messages:
    1,221
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    0
    #24
    Single inheritance..

    Each class can have only one parent, but each parent can extend in itself another class and so and and so on. Any class can be a parent to multiple also.

    So:
    [Scenario 1]
    A ----> B -----> C
    or
    [Scenario 2]
    A -----> B
    A -----> C

    But not:

    A ------> Z
    B ------> Z
    C ------> Z

    I think those diagrams are correct.
     
    Kalyse, May 27, 2007 IP
  5. Nick_Mayhem

    Nick_Mayhem Notable Member

    Messages:
    3,486
    Likes Received:
    338
    Best Answers:
    0
    Trophy Points:
    290
    #25
    For me I don't care much about the versions. My programming is simple just using the basic functions which are available in both the versions. :)
     
    Nick_Mayhem, May 27, 2007 IP
  6. mattcch2007

    mattcch2007 Peon

    Messages:
    562
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #26
    agreed, m$ create c# to face to sun java, seem true as heard:)
     
    mattcch2007, May 28, 2007 IP
  7. gandaliter

    gandaliter Peon

    Messages:
    64
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #27
    Bear in mind that the time Microsoft takes to make a new version of Windows is not at all representative of how long it should take to make a new version of something. ;)
     
    gandaliter, May 29, 2007 IP
  8. Phasm

    Phasm Peon

    Messages:
    126
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #28
    I would personally use PHP5 if you are just starting out, it will be easier to use & implement all features in current versions that way without having to learn new things when you decide to move up.
     
    Phasm, May 29, 2007 IP
  9. FlyByNight

    FlyByNight Peon

    Messages:
    42
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #29
    totally disagree with you on this. Any serious programming needs to be done in OO. PHP5 has the tools to do great software structuring like design patterns. Also if you want solid programming and know how to tune smarty, I would recommend using PHP5, Smarty (the V part in MVC for the view) and MC (model-Controller) using the Zend framework. This will give you big flexibility in terms of changing the view seperatly from the business logic. Professional programming, use PHP5. PHP4 is used widely by websites, and I do a lot of custom programming for my clients (mostly PHP4), it's a mess though.

    Your humble servant
     
    FlyByNight, May 30, 2007 IP
  10. krt

    krt Well-Known Member

    Messages:
    829
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    120
    #30
    Agree with you FlyByNight. While procedural code serves its purpose and unless it is small-medium project and/or you are working alone, it often ends up as a mess. phpMyAdmin and osCommerce are about the only two popular apps that are exceptions and keep in mind they were written when OOP in PHP was not too flash.

    PHP5 and OOP works great except for dealing with distributing scripts that end up on PHP4. The news of PHP6 is speeding up the upgrade process but until then, the solution seems to be to leave OOP for later or make separate versions of script for PHP4 and 5. While this has its obvious disadvantages, particularly the initial workload (especially if you decide to code an application framework yourself), I still prefer it and it saves time in the long run.
     
    krt, Jun 1, 2007 IP
  11. projectshifter

    projectshifter Peon

    Messages:
    394
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #31
    I don't think it's quite fair to say that any serious program needs to be done object oriented. It may be easier if you're doing a large project as a team for organizational purposes, but it's far from necessary. Object oriented coding is very handy and almost essential for large applications and things with multi-levels, but unless you're writing a PHP application (generally dealing with socket servers and not HTTP based), there are no real benefits other than perhaps organization with multiple programmers, and procedural coding is pretty effective for a website, there isn't a real need to handle client<->server communication channels other than passing a few GET/POST variables, so many of the perks of object orientation become a moot point.
     
    projectshifter, Jun 1, 2007 IP
  12. zonzon

    zonzon Peon

    Messages:
    100
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #32
    PHP5 better OO support for new system architectures, xml-rpc, soap etc...
    You can try to develop it cross compatible to php4 and php5 :D
     
    zonzon, Jun 1, 2007 IP
  13. eyesdrinker

    eyesdrinker Greenhorn

    Messages:
    99
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    20
    #33
    Of course PHP5
     
    eyesdrinker, Jun 8, 2011 IP
  14. daxguy

    daxguy Peon

    Messages:
    32
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #34
    well i think php5 is alot more better than php4 cuz php5 have an extended libraries and functions
     
    daxguy, Jun 8, 2011 IP
  15. Nahid

    Nahid Peon

    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #35
    Ofcourse php5 and I recommend to use php 5.3.5 which supports the namespace
     
    Nahid, Jun 8, 2011 IP
  16. mpa360

    mpa360 Peon

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #36
    php.net/manual/en/language.oop5.php

    Clear that PHP 5 is better,
    PHP 5 came with more object-oriented features...
     
    mpa360, Jun 9, 2011 IP
  17. pr-biztech

    pr-biztech Peon

    Messages:
    76
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #37
    Can you explain here which features are not available in PHP4?
    Thanks in advance.
     
    pr-biztech, Jun 9, 2011 IP
  18. 812402

    812402 Peon

    Messages:
    27
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #38
    PHP5 has bug fixes and new features. It is obviously better.
     
    812402, Jun 12, 2011 IP
  19. The Webby

    The Webby Peon

    Messages:
    1,852
    Likes Received:
    30
    Best Answers:
    1
    Trophy Points:
    0
    #39
    Mostly people avoid OOP because of the complexity and learning curve. Having done coding in C, C++, Java, C#, AS3 and PHP, I can assure you that there is nothing better than OOP. Its not just distributed environment, OOP provides you better modularity, scalability, security and better organized codes, even for a single programmer environment. Yes, if all your php code does, is get form data and save it in database, OOP will not offer anything of any significance. But think about a CMS, a Game engine, or a CRM software and try that in procedural, then tell me OOP is useless!! Although, OOP in PHP is still in infancy, and inadequate.

    On the side note: You probably don't want to make a socket server in php, if you ever need simultaneous connectivity of more than 25 clients, php socket servers are damn slow, resource hogs and simply incapable.
     
    The Webby, Jun 12, 2011 IP
  20. pr-biztech

    pr-biztech Peon

    Messages:
    76
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #40
    Thanks, But which is new features included in PHP5. Are you using PHP5 currently?
     
    pr-biztech, Jun 13, 2011 IP