PHP code example of herrera-io / version

1. Go to this page and download the library: Download herrera-io/version library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

herrera-io / version example snippets


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();