Re: version numbers
| From: | Andrei Zmievski | Date: | Thu, 24 May 2001 13:20:24 +0000 |
| Subject: | Re: version numbers | ||
| References: | 1 | Groups: | php.dev php.general |
| Request: | Send a blank email to php-dev+get-56620@lists.php.net to get a copy of this message | ||
On Wed, 23 May 2001, Dennis Gearon wrote:
> I wonder about the version numbers because of some of the alphanumeric
> values in them.
>
> Are the version numbers chosen such that ANY version higher can be
> checked for by the following code:
>
> if ( strcmp($ver_running_under, $min_version) > 0){
> use feature;
> } else {
> use big nasty, ugly own version of functionality
> -or-
> issue warning that results may not be correct
> because functionality is not necessarily available,
> i.e. getting the REAL include directory being used
> before version 4.
> }
Use strnatcmp() function -- it works very well for version comparison.
-Andrei
* It said 'Winmodem' on the box, but I still feel like I lost. *