Skip to content

Instantly share code, notes, and snippets.

@Cvar1984
Created August 21, 2020 17:02
Show Gist options
  • Save Cvar1984/428d1b7031f4e5f134a7dd5f8b24076b to your computer and use it in GitHub Desktop.
Save Cvar1984/428d1b7031f4e5f134a7dd5f8b24076b to your computer and use it in GitHub Desktop.
<?php
/**
* Class: Info
*
*/
class Info
{
/**
* getPhpVersion
* @return string
*
*/
public static function getPhpVersion()
{
return PHP_VERSION;
}
/**
* getServerInfo
* @return string
*
*/
public static function getServerInfo()
{
return php_uname();
}
/**
* getPhpDeclaredClasses
* @return array
*
*/
public static function getPhpDeclaredClasses()
{
return get_declared_classes();
}
/**
* getPhpIncludedModules
* @return array
*
*/
public static function getPhpIncludedModules()
{
return get_loaded_extensions();
}
/**
* getPhpExtensionDir
* @return string
*
*/
public static function getPhpExtensionDir()
{
return PHP_EXTENSION_DIR;
}
/**
* isPhpZts
* @return bool
*
*/
public static function isPhpZts()
{
return (bool)PHP_ZTS;
}
}
var_dump(Info::getPhpExtensionDir(), Info::isPhpZts());
/* https://www.php.net/manual/en/reserved.constants.php */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment