PHP-Version是一个用来创建、编辑、比较语义版本号的库。目前,支持2.0.0版语义规范版本。
示例代码:
use Herrera\Version\Dumper;use Herrera\Version\Parser;$builder = Parser::toBuilder('1.2.3-alpha+2');$builder->incrementMajor();$builder->clearBuild();$builder->clearPreRelease();echo Dumper::toString($builder); // echoes "2.0.0"$finalVersion = $builder->getVersion();
评论