/    Sign up×
Community /Pin to ProfileBookmark

PHP4 / PHP5 – What is the difference?

PHP.NET seems to consider both of these mature releases. What is the difference? Is there any reason to to pick 4x over 5x?

to post a comment
PHP

16 Comments(s)

Copy linkTweet thisAlerts:
@MarkLJun 01.2005 — There are several differences, both in configuration, and the way certain functions and expressions are handled. PHP 4 has a larger installed base at this point, but since PHP is server side, this is generally not going to effect the end user. If you have PHP 4 already, there is not much reason to upgrade to PHP 5, but if you are not already using PHP, and are asking which one to go with, I would suggest PHP 5.
Copy linkTweet thisAlerts:
@scaiferwauthorJun 01.2005 — That was fast, thanks.
Copy linkTweet thisAlerts:
@Stephen_PhilbinJun 01.2005 — In very simple terms it has more features and its OOP implementation is vastly improved.
Copy linkTweet thisAlerts:
@bokehmanJun 01.2005 — PHP4:

$fp = fopen($filename, 'a');

fwrite($fp, $somecontent);

fclose($fp);

Same job with PHP5

file_put_contents ($filename, $somecontent);
Copy linkTweet thisAlerts:
@scaiferwauthorJun 02.2005 — That sounds like reason enough. Now, is there any reason NOT to switch from PHP4 to PHP 5?
Copy linkTweet thisAlerts:
@Stephen_PhilbinJun 02.2005 — None that I know of. Onlt the same problems you could expect from changing hosts to upgrading from something like php4.3.1 to php4.3.2. That being the general config being different. Y'know, like register globals being off etc.
Copy linkTweet thisAlerts:
@SpectreReturnsJun 03.2005 — With some versions of PHP5, HTML authorization doesn't work. It might be in all, I don't know if it's been fixed yet.
Copy linkTweet thisAlerts:
@Stephen_PhilbinJun 03.2005 — What do you mean by "HTML authorisation"? There is one thing I just found that PHP doesn't have. A DOM API. They ditched the PHP4 implementation in favour of a new one that nobody has built yet. I know there's virtually nobody that does want/need it yet, but it's a bit of a pain in the arse for those that do.
Copy linkTweet thisAlerts:
@felgallJul 19.2006 — I suggest that you go with whichever version of PHP that your web hosting supports. You wont get very far it you try to use version 5 code if your hosting only supports 4.
Copy linkTweet thisAlerts:
@LiLcRaZyFuZzYJul 19.2006 — Also with PHP5 it's by far easier to read in XML files (no more self-built functions, much quicker, simpler, simpleXML ? )
Copy linkTweet thisAlerts:
@NogDogJul 19.2006 — Also, this is a 1-1/2 month old thread that was re-opened. ?
Copy linkTweet thisAlerts:
@bokehJul 19.2006 — Also, this is a 1-1/2 month old thread that was re-opened. ?[/QUOTE]Is there not a feature on this board that can automatically close threads if they haven't had posts for a certain period.
Copy linkTweet thisAlerts:
@LiLcRaZyFuZzYJul 20.2006 — damn! i didn't see that..
Copy linkTweet thisAlerts:
@scaiferwauthorJul 21.2006 — As the OP, it's interesting to see this come back to life.

It's interesting though, that webhosts don't seem to be widely running PHP5, at least not the two that I work with. Why is that?
×

Success!

Help @scaiferw spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.3,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...