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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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: Sun Dec 22 04:01:29 2024 UTC