FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


4 or 5?





CompDude
What is th edifference between php4 and php5? I am really confused about these.
rickylau
The basic functionalities of PHP4 and 5 do not have significant difference to the users in my opinion. The major change in PHP5 is that it is powered by Zend Engine II, as Wikipedia said
Wikipedia wrote:
PHP 5 included new features such as improved support for object-oriented programming, the PHP Data Objects extension (which defines a lightweight and consistent interface for accessing databases), and numerous performance enhancements.

Full changelog can be seen in PHP official website, where you can know what PHP5 have been improved for.
snowboardalliance
rickylau wrote:
The basic functionalities of PHP4 and 5 do not have significant difference to the users in my opinion. The major change in PHP5 is that it is powered by Zend Engine II, as Wikipedia said
Wikipedia wrote:
PHP 5 included new features such as improved support for object-oriented programming, the PHP Data Objects extension (which defines a lightweight and consistent interface for accessing databases), and numerous performance enhancements.

Full changelog can be seen in PHP official website, where you can know what PHP5 have been improved for.


Yeah I'd say the revised OOP is a big benefit in php5. Of course there are tons of little changes but that always sticks out in my mind.
inphurno
apart from some real object oriented support (private, public, protected members/function, inheritance, etc.) one thing i find important is added support of xml. Read, writing and working with xml is a lot easier in php5, no need to use any external classes.

At any rate if you are just starting out with php you are better of to start learning with php5 since php6 will be out soon (if its not out all ready). If you start learning to code the php4 way you might develop a lot of bad habits that won't be doable in php6
b4r4t
Most difference is that ... PHP4 is NOT SUPPORTED ... it's abbandoned Smile There is almost no reason to use it now. By the way - PHP5 have lot of new functions which can be a time saver Smile

And ... OOP - that's verry important Smile __construct, __destruct, magic functions, auto loading and lot more Smile
Peterssidan
b4r4t wrote:
Most difference is that ... PHP is NOT SUPPORTED ... it's abbandoned Smile There is almost no reason to use it now.

You mean php4 is not supported. Don't scare people like that :p

php4 is older than php5. Only good reason to use php4 is if you want to make sure your code is compatible with older versions of php. php5 is compatible with php4 so php4 code will work in php5 but not the other way around.
b4r4t
Peterssidan wrote:
b4r4t wrote:
Most difference is that ... PHP is NOT SUPPORTED ... it's abbandoned Smile There is almost no reason to use it now.

You mean php4 is not supported. Don't scare people like that :p.


Yes - I meant PHP4 ... my bad Smile Edited and changed Smile

Peterssidan wrote:

php4 is older than php5. Only good reason to use php4 is if you want to make sure your code is compatible with older versions of php. php5 is compatible with php4 so php4 code will work in php5 but not the other way around.


"Good" example is WordPress which is structural PHP4 + some "hacks" to mimic PHP5 functions Wink
I'm studying WordPress code now and I must say that ... this is verry oldschool in meny places Wink
snowboardalliance
Peterssidan wrote:
b4r4t wrote:
Most difference is that ... PHP is NOT SUPPORTED ... it's abbandoned Smile There is almost no reason to use it now.

You mean php4 is not supported. Don't scare people like that :p

php4 is older than php5. Only good reason to use php4 is if you want to make sure your code is compatible with older versions of php. php5 is compatible with php4 so php4 code will work in php5 but not the other way around.


Yes it's for the most part backwards compatible. Might run into some issues if you follow bad practice but hey, that's a bad idea to begin with.

Still, I'd stick with php5 and you'll be pretty safe these days
ProwerBot
Most people probably will not notice a difference if they upgraded from PHP4 to PHP5.


If I'm right, they just added some new commands.
Related topics
A good English song , I like it
Install Mambo 4.5.2 And Vbulletin 3.0.7
Do you give 100% at work ?
How do you like Star Wars III?
Little Johny
The 4 FRIH$ Store
Using pgSQL and MS SQL with php 4/5
15 Years @ $4.5 Million
Oceans may rise over 4 1/2 feet by 2100
5 points/frih$ per post
Free GAG v4.5 Boot Manager
Learning To Juggle 5 Balls
DVD Writer writing upto 4.5 GB
Safari 4... a eye candy
Mathematical question to tease your brain
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.