Edit report at https://bugs.php.net/bug.php?id=62586&edit=1

 ID:                 62586
 Comment by:         mail+php at requinix dot net
 Reported by:        dattaya108 at gmail dot com
 Summary:            version_compare, case sensitivity
 Status:             Open
 Type:               Bug
 Package:            Unknown/Other Function
 Operating System:   Linux
 PHP Version:        5.3.14
 Block user comment: N
 Private report:     N

 New Comment:

>Is there a page in the documentation that describes what's a 
>"PHP-standardized" 
version number?
The description block gives a fairly precise explanation for how version 
numbers 
are compared: after a couple character replacements, numeric parts are compared 
as numbers and non-numeric parts (eg, "alpha" and "rc") are compared according 
to a hierarchy.

>hmm, you can strtolower before compare, I'd prefer this to be a doc problem..
The operator parameter says "This parameter is case-sensitive, so values should 
be lowercase". Maybe move that somewhere more obvious, like the description or 
a 
note?


Previous Comments:
------------------------------------------------------------------------
[2012-07-17 14:53:13] [email protected]

hmm, you can strtolower before compare, I'd prefer this to be a doc problem..

------------------------------------------------------------------------
[2012-07-17 11:09:14] dattaya108 at gmail dot com

Wrong test script was provided. Right one:
var_dump(version_compare('2.1.0-DEV', '2.1.0-dev', '<'));

------------------------------------------------------------------------
[2012-07-17 10:58:14] dattaya108 at gmail dot com

Is there a page in the documentation that describes what's a "PHP-standardized" 
version number?

------------------------------------------------------------------------
[2012-07-17 10:54:02] dattaya108 at gmail dot com

Description:
------------
Is this behavior intentional? If so, should the bug type be changed to 
'documentation problem'?

Test script:
---------------
var_dump(version_compare('2.1.0-DEV', '2.1.0-dev'));

Expected result:
----------------
bool(false)

Actual result:
--------------
bool(true)


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



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

Reply via email to