Doc #62586 [Com]: version_compare, case sensitivity
| From: | dattaya108 at gmail dot com | Date: | Fri, 20 Jul 2012 06:22:40 +0000 |
| Subject: | Doc #62586 [Com]: version_compare, case sensitivity | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-8601@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=62586&edit=1
ID: 62586
Comment by: dattaya108 at gmail dot com
Reported by: dattaya108 at gmail dot com
Summary: version_compare, case sensitivity
Status: Closed
Type: Documentation Problem
Package: Documentation problem
Operating System: Linux
PHP Version: 5.3.14
Assigned To: aharvey
Block user comment: N
Private report: N
New Comment:
Actually it's working that way, I forget that "RC = rc".
Previous Comments:
------------------------------------------------------------------------
[2012-07-20 06:17:14] dattaya108 at gmail dot com
Thank you aharvey!
I was going to propose to change it to something like this
```
Special version strings such as <literal>alpha</literal> and
<literal>beta</literal> should be lowercase. Otherwise they will be treated as
<literal>any string not found in this list</literal>.
```
but after a test it turned out that it's not working that way:
var_dump(version_compare('2.1.0-DEV', '2.1.0-dev', '<'));
var_dump(version_compare('2.1.0-ALPHA', '2.1.0-dev', '<'));
var_dump(version_compare('2.1.0-BETA', '2.1.0-dev', '<'));
var_dump(version_compare('2.1.0-RC', '2.1.0-dev', '<'));
bool(true)
bool(true)
bool(true)
bool(false)
------------------------------------------------------------------------
[2012-07-20 02:24:22] aharvey@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation better.
------------------------------------------------------------------------
[2012-07-20 02:24:20] aharvey@php.net
Automatic comment from SVN on behalf of aharvey
Revision: http://svn.php.net/viewvc/?view=revision&revision=326719
Log: Fix doc bug #62586 (version_compare, case sensitivity) by adding a note about
case sensitivity.
------------------------------------------------------------------------
[2012-07-19 05:44:12] dattaya108 at gmail dot com
And this: "This parameter is case-sensitive, so values should
be lowercase". is probably about the parameter itself:
var_dump(version_compare('2.1.0-dev', '2.1.0-dev', 'lt'));
var_dump(version_compare('2.1.0-dev', '2.1.0-dev', 'LT'));
bool(false)
NULL
------------------------------------------------------------------------
[2012-07-19 05:33:04] dattaya108 at gmail dot com
Yes, definitely, because without third parameter result is the same:
var_dump(version_compare('2.1.0-DEV', '2.1.0-dev'));
var_dump(version_compare('2.1.0-dev', '2.1.0-dev'));
int(-1)
int(0)
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=62586
--
Edit this bug report at https://bugs.php.net/bug.php?id=62586&edit=1