ID:               14704
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
-Status:           Open
+Status:           Closed
 Bug Type:         Feature/Change Request
 Operating System: all
 PHP Version:      4.1.0
 New Comment:

you need to use version_compare() to compare versions. (they aren't
always entirely numeric.)


Previous Comments:
------------------------------------------------------------------------

[2001-12-26 15:20:05] [EMAIL PROTECTED]

Look:
<?PHP

// return 4.1
print (float)PHP_VERSION;

$v = 4.1.4;
// return 4.1
print (float)$v;
?>

If someone wants to compare the versions of PHP, so he need to create a
preg-like routine to change the string of PHP version to double
numbers.

So, you can rewrite in C the phpversion to

function phpversion($withFloat = FALSE) {
  if ($withFloat == TRUE) {
    return 4.14;
  }
  return "4.1.4";
}

So, if someone want a float number, he will call phpversion(1); 

<?PHP

// output 4.14
print phpversion(1);

// output 4.1.4
print phpversion();
?>

Thanx.

------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=14704&edit=1

Reply via email to