<?php namespace xp\runtime;

use util\cmd\Console;

/**
 * Displays XP version and runtime information
 */
class Version {
  
  /**
   * Main
   *
   * @param   string[] args
   * @return  int
   */
  public static function main(array $args) {
    Console::writeLinef(
      'XP %s { PHP %s & ZE %s } @ %s', 
      \xp::version(),
      phpversion(),
      zend_version(),
      php_uname()
    );
    Console::writeLine('Copyright (c) 2001-2016 the XP group');
    foreach (\lang\ClassLoader::getLoaders() as $delegate) {
      Console::writeLine($delegate->toString());
    }
    return 1;
  }
}

<?php namespace xp\runtime;

use util\cmd\Console;

/**
 * Displays XP version and runtime information
 */
class Version {

  /** @return string */
  private function xpVersion() { return 'XP/'.\xp::version(); }

  /** @return string */
  private function phpVersion() { return 'PHP/'.phpversion(); }

  /** @return string */
  private function engineVersion() { return defined('HHVM_VERSION') ? 'HHVM/'.HHVM_VERSION : 'Zend/'.zend_version(); }

  /** @return string */
  private function osVersion() {
    if ('Linux' == PHP_OS && is_executable('/usr/bin/lsb_release')) {
      return 'Linux/'.strtr(`/usr/bin/lsb_release -scd`, "\n", ' ');
    } else {
      return PHP_OS.'/'.php_uname('v');
    }
  }

  /**
   * Main
   *
   * @param   string[] $args
   * @return  int
   */
  public static function main(array $args) {
    if (isset($args[0])) {
      $method= $args[0].'Version';
      Console::writeLine(self::$method());
    } else {
      Console::writeLinef(
        'XP %s { PHP %s & ZE %s } @ %s',
        \xp::version(),
        phpversion(),
        zend_version(),
        php_uname()
      );
      Console::writeLine('Copyright (c) 2001-2016 the XP group');
      foreach (\lang\ClassLoader::getLoaders() as $delegate) {
        Console::writeLine($delegate->toString());
      }
      return 1;
    }
  }
}

Implement version details xp, php, engine and os
Implement version details xp, php, engine and os

. xp: XP Version
. php: PHP Version
. engine: Engine version - HHVM_VERSION || zend_version()
. os: OS Version (and distribution if available)
