diff --git a/src/Peachpie.Library/Miscellaneous.cs b/src/Peachpie.Library/Miscellaneous.cs index 6eeee45d4b..966f860993 100644 --- a/src/Peachpie.Library/Miscellaneous.cs +++ b/src/Peachpie.Library/Miscellaneous.cs @@ -71,6 +71,11 @@ static string[] VersionToArray(string version) { if (last != '.') { + if (sb.Length == 0) + { + sb.Append('0'); // prepend leading '.' with '0' // TODO: test case and rewrite 'version_compare()' + } + sb.Append(last = '.'); } }