Bug #75806 [Opn->Nab]: version_compare does strange things with string starting with "p"
| From: | cmb@php.net | Date: | Fri, 12 Jan 2018 22:24:28 +0000 |
| Subject: | Bug #75806 [Opn->Nab]: version_compare does strange things with string starting with "p" | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-213516@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=75806&edit=1
ID: 75806
Updated by: cmb@php.net
Reported by: ksours at internetbrands dot com
Summary: version_compare does strange things with string
starting with "p"
-Status: Open
+Status: Not a bug
Type: Bug
-Package: *General Issues
+Package: PHP options/info functions
PHP Version: 7.0.27
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
'1.0.0ptotalgarbage' is treated as '1.0.0.p.â¦', which is higher
than '1.0.0'.
Previous Comments:
------------------------------------------------------------------------
[2018-01-12 00:21:07] ksours at internetbrands dot com
Description:
------------
version_compare appears to treat any string starting with p at the pl=p level when doing
comparisons, which is contrary to the documented behavior
Test script:
---------------
echo version_compare('1.0.0', '1.0.0ptotalgarbage');
Expected result:
----------------
1
Actual result:
--------------
-1
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=75806&edit=1