I upgraded last week specifically for the new PHP5 functions. I love the new OOP functions, class autoloaders and other things. Go for 5.
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++?
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.
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.
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.
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.
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
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.
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.
PHP5 better OO support for new system architectures, xml-rpc, soap etc... You can try to develop it cross compatible to php4 and php5
php.net/manual/en/language.oop5.php Clear that PHP 5 is better, PHP 5 came with more object-oriented features...
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.