Skip to content

Bug on Sort with regard to item 9 of SemVer Specification #22

@glandre

Description

@glandre

Hello,

First of all, I want to congratulate your project. It'll be very useful.
I'm using semver to manage versions of a library I'm implementing, and, I noticed a small error. The following string causes the error: 1.0.5-beta.0.5. This string comprises the 9th item from SemVer Specification. The following code illustrates the problem:

<?php
use Naneau\SemVer\Sort;

$strs = array(
"1.0.5-beta.0.5",
);

$sorted = Sort::sort($strs);

echo "[original]: $strs[0]\n";
echo "[after sort]: $sorted[0]\n";

Output:

[original]: 1.0.5-beta.0.5
[after sort]: 1.0.5-0.0.5

Bests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions