UnexpectedValueException on a "special" PHP version string #1322

jochil opened this Issue Nov 13, 2012 · 4 comments


None yet
2 participants

jochil commented Nov 13, 2012


if you are using a (self compiled) php environment with a version string like this "5.3.8+someString" you will get an UnexpectedValueException if you defined a minimum php version in the composer.json:

  "require": {
        "php": ">=5.3.3",

The exception is thrown by VersionParser->normalize(). According to the PHP docu (e.g. http://php.net/manual/en/function.version-compare.php) this kind of version string should be valid.


Seldaek commented Nov 13, 2012

What's your exact version number from php -v?

jochil commented Nov 13, 2012

I noticed it on this version: PHP 5.3.13+selfCompiled5

Seldaek closed this in 172414a Nov 14, 2012


Seldaek commented Nov 14, 2012

Alright, we supported -foo, I had never seen it with a +, but it should now work.

jochil commented Nov 14, 2012

nice... thank you

@digitalkaoz digitalkaoz pushed a commit to digitalkaoz/composer that referenced this issue Nov 22, 2013

@Seldaek Seldaek Add support for ~/+ in addition to - as separator between PHP version…
… and build details, fixes #1322
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment