tags:

views:

74

answers:

3

I'm assuming every modern hosting provider gives access to php5 (and i noticed that many have both 4 and 5) but now WHICH php5 is most popular... let's say i'm trying to choose between curl copy handle and curl setopt array (in my previous question)... but curl setopt array is available in php 5.1.3 while curl copy handle is available in earlier versions... so now how do i know if it's worthwile to use thing that works with newer version? How do i know if php 5.1.3 is used widely enough? I'm trying to make my application run on most configurations available.

+2  A: 

According to this website, the most popular version of PHP on May 9, 2008 (over a year ago) was PHP 5.2.5. So, you'd probably be OK using 5.1.3 + features.

Jasie
that's what i'm looking for, but is it real data?
Phil
Well, it's linked from the PHP website, so they consider it trust-worthy. Here's part of their methodology: "28 millions servers hosted on 2 millions IP were surveyed during March, and 12.5 were used for stats : domaines without web sites, those unreachable, ISP, shared hosters or domain parkings were not considered. " http://www.nexen.net/chiffres_cles/phpversion/18363-php_statistics_for_april_2008.php
Jasie
+3  A: 

Use the function_exists method to check for which function exists, then use that one. That way you don't have to worry about which version of PHP is being used. It's the same idea as the feature-detection vs browser-detection debate in javascript.

tj111
interesting.....
Phil
+1  A: 

Besides what tj111 mentioned, the PHP version doesn't really mean which functions will or will not be available. Many hosts, specially free hosts, disable features like cURL, mail(), ZipArchive, image* functions, system(), exec(), passthru() etc. If you want to check for dependences, its recommended to check for exactly what you need with function_exists().

Havenard