naneau / semver

PHP Semantic Versioning library
MIT License
73 stars 9 forks source link

Wrong sorting for patches #24

Open andkirby opened 8 years ago

andkirby commented 8 years ago

I was trying to use your module and...

1.7.0-alpha.0
1.7.0-patch.0
1.7.0-patch2.0
1.7.0-patch.1
1.7.0-patch3.0
1.7.0-patch4.0
1.7.0

Patch must be in the end as I understand.

andkirby commented 8 years ago

version_compare works properly.

    array_walk($versions, 'trim');
    usort($versions, 'version_compare');