The semver parser for node (the one npm uses), ported to PHP