![]() |
PHP Developers... please join me for a discussion on PHP5.
We all know that PHP5 is better than PHP4... that's great. But can you give some real world (maybe personal) examples of yours where you've found PHP5 to be preferred over PHP4.
Don't get me wrong with this thread, I have my own to share but I'd like to have this more as an informative thread for all developers to learn and share. It's one thing to read up the new features and new terminology... but I'd love to hear anyone who's been developing for PHP5 to share personal experiences. |
Well, personally the main advantage of 5 over 4 for me is the additional functions. SimpleXML for example, makes parsing xml significantly easier. The addition of file_get_contents/file_put_contents (I forget which was added in php5) has also made it much easier to work with flat files.
Additionally, php4 has had its end of life announcement, and as of the new year no additional versions of php4 will be released. The only incompatibilities between scripts I've seen for php4 not running under php5, is due to register_globals being off by default in php5. |
Also be careful with the use of array_merge in your code when moving from php4 to 5 :2 cents:
|
Quote:
|
Ok, so SimpleXML makes xml easier.
array_merge() now only takes array types rather than just allowing anything to be merged in. Register_globals is now off by default, as it should be. Awesome stuff... has anyone been doing some more advanced class/object creation using PHP5 yet? |
Quote:
|
SimpleXML hands down. Parsing feeds is effortless.
|
There were a lot of enhancements to php5, security fixes, speed fixes as well as OOP changes. Things like private, public and static functions etc. PHP5 should be used imho over php4, but hosts have done a poor job of getting php5 in the market place. That being said, php5 has major issues like namespaces. To me PHP5 has pretty much died and most of my stuff has been replaced with other languages that are not only faster but much more structured.
PHP6 is going to have a lot of these things fixed supposedly , but I will believe it when I see it. |
Quote:
|
Quote:
|
All times are GMT -7. The time now is 06:04 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123