php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45662 'pre' token should be added to version_compare
Submitted: 2008-07-31 01:31 UTC Modified: 2008-08-01 12:02 UTC
From: geoff at darktrojan dot net Assigned:
Status: Not a bug Package: PHP options/info functions
PHP Version: 5.2.6 OS: *
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: geoff at darktrojan dot net
New email:
PHP Version: OS:

 

 [2008-07-31 01:31 UTC] geoff at darktrojan dot net
Description:
------------
To allow correct comparison of Mozilla versioning numbers (e.g. comparing user-agent strings), the token 'pre' should be added to version_compare. Mozilla use pre to indicate a pre-alpha release (e.g. 3.0a8pre is earlier than 3.0a8).

pre should have the same status as dev in /ext/standard/versioning.c

Reproduce code:
---------------
echo version_compare ('3.0a8pre', '3.0a8');

Expected result:
----------------
-1

Actual result:
--------------
1

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-08-01 12:02 UTC] felipe@php.net
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

Says the documentation:
'version_compare() compares two "PHP-standardized" version number strings.'

PHP doesn't use 'pre'.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 16:01:28 2024 UTC