PHP: version_compare() returns -1 when comparing 5.2 and 5.2.0?

php

Solution

The documentation says it compares 'two "PHP-standardized" version number strings'.

You're comparing one PHP-standardized version number string with one non-PHP-standardized version number string.

Problem

``` version_compare('5.2', '5.2.0'); // returns -1, as if the second parameter is greater! ``` Isn't 5.2 and 5.2.0 suppose to be equal? (isn't 5.2 and 5.2.0.0 are also equal)?

Original source