By green monkey on
Hi,
I'm in the process of changing Hosts.
With the new Host I can run php5 or php4.
I know Drupal now runs on php5, but I don't know enough to know I why I would want or need to run php5.
Could anyone offer a pros and cons summary?
Thanks
J
PS: I also made a heads-up post about DreamHost today, that is worth a look if you are looking to relocate too, in the near future. They're offering 80% off.
Comments
My view
is that PHP5 doesn't offer any real advantages yet as Drupal is coded for PHP4. There may still be the odd bug in some modules under PHP5 as it hasn't had as much testing.
If you have the choice, I'd stay on PHP4 until Drupal starts using PHP5 specific features. That's just my opinion though.
PHP5 does have much better OO support, but it will be a very long time (if ever) before Drupal fully uses it.
--
Anton
ditto that
I have set up test sites on PHP 5 and PHP 4 in both LAMP and WAMP environments, and in both circumstances, sites with identical configurations had some issues in PHP 5 -- nothing debilitating, but enough small things to be very annoying.
Just my .02
Cheers,
bonobo
-------
http://www.funnymonkey.com
Tools for Teachers
-------
http://www.funnymonkey.com
Never
http://drupaldocs.org/api/head/file/contributions/docs/developer/topics/...
Drupal won't likely to use classes. It's just not our way and I am super happy with it.
--
Read my developer blog on Drupal4hu.
--
Drupal development: making the world better, one patch at a time. | A bedroom without a teddy is like a face without a smile.
really
really
don't bother
I have had a lot of problems with PHP5 and Drupal. It honestly seems like the PHP developers break something (or rather, they fix something that was broken in the first place, "breaking" all code that relied on it) every month.
Given that Drupal does not yet use any PHP5 features, nor is PHP5 that much faster than PHP4, there's no reason to pair them together. Save yourself some grief and stick with PHP4.
__
My Drupal websites: Personal home page | Rhombic Networks: specialized Drupal application hosting
I can't really summarize
I can't really summarize anything directly but I do see a lot of advantages to using php5 in Drupal. These are not anything that the user will see but they might like the end result of the developer being able to do things in a better nicer cleaner way. Maybe some new functionality will come because php4 has limitations which make code changes difficult or impossible.
Advantages,none of them have to do with using OOP ;)
The code becomes cleaner and shorter because of some of the newer functions http://docs.php.net/en/migration5.html. The way
arrays
strings
are used in Drupal could be changed and made more powerful.
Iterators, some are built in php5 (you can build your own but that would require OOP). As a Java person I like the iterators simplicity.
is easier to read and know this way.
In PHP 4, you could not iterate through an array and modify its values. PHP 5 supports this by allowing you to mark the foreach() loop with the ‘&’ (reference) sign, thus, making any values you change affect the array you’re iterating over.
(this is my favorite!)
In PHP 4, default values could only be given to parameters which are passed by-value. Giving default values to by-reference parameters is now supported.
Probably will not convince drupal developers to use php5.All very boring stuff if you are not a programmer. Probably will not change your life either.
But it is interesting stuff to some :)
thanks gang
thanks gang,
since I'm the type that perfers an old pair of broken in shoes, verses a new pair of shoes
you made this decision a lot easier