简体   繁体   English

version_compare指示xy0高于xy?

[英]version_compare indicating x.y.0 is higher than x.y?

Why does 为什么

version_compare('3.8.0', '3.8', '>')

return true ? 返回true吗?

In terms of versioning, one would expect both to be identical, but version_compare indicates that 3.8.0 is higher than 3.8. 在版本控制方面,人们希望两者相同,但是version_compare表示3.8.0高于3.8。 Is there any workaround for this weird behaviour? 这个怪异的行为有什么解决方法吗?

Running PHP 5.2.17 运行PHP 5.2.17

From the top of my head it feels that it could be that 3.8.0 > 3.8 since you have to imagine a regular charting x,y graph...it's a 2 dimension chart.... but it could be that if you add a 0 to the x,y axis you get a 3 dimesional chart ie a higher type of expression than just the 2D one... That is the only logical explaination I could make from it...but maybe I am crazy : ) ...and that's fine... better crazy than stuck up : ) 从我的头顶开始,感觉可能是3.8.0> 3.8,因为您必须想象一个常规的x,y图形图表...这是一个二维图表....但是如果您添加从0到x,y轴,您会得到3维图表,即比2D图表更高级的表达方式...那是我可以从中做出的唯一合理的解释...但也许我很疯狂:)。 ..那很好...疯了总比卡住了:)

Yours Truly kevin 01001100010011110101011001000101 to googolplex 将您真正的凯文01001100010011110101011001000101送至googolplex

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM