Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

phpversion

Description

The phpversion of Options / Information for PHP gets the current PHP version.

Syntax

phpversion(
    ?string $extension = null
): string|false

Parameters

extension

An optional extension name.

Return

Returns the current PHP version as a string. If a string argument is provided for extension parameter, phpversion() returns the version of that extension, or false if there is no version information associated or the extension isn't enabled.

Examples

1 · void

<?

$return = phpversion();

echo $return;

?>
8.3.0

2 · extension

<?

$extension = 'zip';

$return = phpversion($extension);

echo $return;

?>
1.22.3

3 · PHP_VERSION

<?

$array = explode('.', PHP_VERSION);

define('PHP_VERSION_MAJOR', $array[0]);
define('PHP_VERSION_MINOR', $array[1]);
define('PHP_VERSION_RELEASE', $array[2]);

echo PHP_VERSION . PHP_EOL . PHP_EOL;
echo PHP_VERSION_MAJOR . ': major' . PHP_EOL;
echo PHP_VERSION_MINOR . ': minor' . PHP_EOL;
echo PHP_VERSION_RELEASE . ': release';

?>
8.3.0

8: major
3: minor
0: release
HomeMenu