PHP code example of pakled / vernum

1. Go to this page and download the library: Download pakled/vernum 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/ */

    

pakled / vernum example snippets


use Vernum\Parser;
use Vernum\Version;

$parsedVersion = Parser::parse("1.0.2-dev");

$version = new Version(
	$parsedVersion['major'],
	$parsedVersion['minor'],
	$parsedVersion['patch'],
	$parsedVersion['labels']
);

echo $version->getMajor();
echo $version->getMinor();
echo $version->getPatch();