2 Responses

  1. Konstantin Kovshenin
    Konstantin Kovshenin October 17, 2012 at 12:10 | | Reply

    Typo in snippet #3, missing single quote around ‘jquery’. Also, the fourth argument (the version) is expecting a string, but you’re giving it a float. It will work, but the 1.0 float converted to a string results in “1” and not “1.0” so you *might* eventually run into trouble:

    var_dump( version_compare( 1.0, ‘1.0’ ) ); // int(-1)

    I can’t think of an example right now, but I recommend to always use strings as version numbers. It has other advantages as well, such as “3.5-beta2” 🙂


Leave a Reply