phpversionGets the current PHP version
&reftitle.description;
stringfalsephpversionstringnullextension&null;
Returns a string containing the version of the currently running PHP
parser or extension.
&reftitle.parameters;
extension
An optional extension name.
&reftitle.returnvalues;
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.
&reftitle.changelog;
&Version;&Description;8.0.0extension is nullable now.
&reftitle.examples;
phpversion example
]]>
PHP_VERSION_ID example and usage
]]>
&reftitle.notes;
This information is also available in the predefined constant
PHP_VERSION. More versioning information
is available using the PHP_VERSION_*
constants.
Some extensions may define their own version number.
However, most bundled extension will use the PHP version as their version number.
&reftitle.seealso;
PHP_VERSION constantsversion_comparephpinfophpcreditszend_version