Version checking
| From: | Alan McFarlane | Date: | Wed, 06 Feb 2002 20:34:22 +0000 |
| Subject: | Version checking | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-83752@lists.php.net to get a copy of this message | ||
What's the best method for checking the PHP version number.
I'm assuming that include() was available in all versions, so, from my main
index.php script, I include a local script (common.php) :
<?php
// assume minimum version of PHP required is 4.0.5
if (phpversion() < 4) { die("wrong version"); }
$ver = explode(".", phpversion());
if ($ver[2] < 5) { die("wrong version"); }
?>
The problem I can see is that some of the earlier 4+ versions had a funny
number scheme - i.e. 4.0.1pl2.
Does anyone have a complete list of version numbers (or a better method of
version checking)?