Veikko Mäkinen

Tuesday, 2009-03-03

» Be Careful with PHP’s version_compare

Be Careful with PHP’s version_compare

var_dump(version_compare("5.2.8-0.dotdeb.1", "5.2.8", "<="));

Expected result: bool(true)

Actual result: bool(false)

The moral of the story: use < or >.

Tags

Comments (View)
blog comments powered by Disqus