phpversion
Function • Params and return types changed in PHP 8.0
Gets the current PHP version.
phpversion Function synopsis
phpversion(?string $extension = null): string|false
Parameters
$extension
OptionalType?stringDefault valuenull
An optional extension name.
$extension accepts one of the following string values:
amqpapacheapcapdbbcodebcmathbcompilerbz2cairocalendarchdbclasskitcomcrackctypecubridcurlcyrusdbadbasedbplusdbxdiodomdotneteioenchanteveventexifexpectfamfbsqlfdffileinfofileprofilterfribidiftpgearmangendergeoipgettextgmagickgmpgnupggupnpharuhtscannerpecl_httphyperwavehwapiinterbaseibm_db2iconvid3informixiisfuncgdimagickimapincludeingresinotifyintljavajsonjudykadm5ktagliblapackldaplibeventlibxmllualzfmailparsemaxdbmbstringmcryptmcvememcachememcachedmemtrackmhashmingmnogosearchmongomqseriesmsessionmsqlmssqlmysqlmysqlimysqlndmysqlnd_memcachemysqlnd_msmysqlnd_muxmysqlnd_qcmysqlnd_uhncursesnet_gophernewtnotesnsapioauthoci8oggvorbisopenalopensslovrimosparadoxparsekitpcntlpcrepdflibpdopdo_4dpdo_cubridpdo_dblibpdo_firebirdpdo_ibmpdo_informixpdo_mysqlpdo_ocipdo_odbcpdo_pgsqlpdo_sqlitepdo_sqlsrvpdo_pgsqlpharposixprinterproctitlepspspellpthreadsqtdomquickhashradiusrarreadlinerecoderpmreaderrrdrunkitsamscascreamsca_sdosysvmsgsessionsession_pgsqlshmopsimplexmlsnmpsoapsocketssolrsphinxspl_typesspplussqlitesqlite3sqlsrvssdeepssh2statsstompsvmsvnswfswishsybasetainttcpwraptidytokenizertokyo_tyranttraderodbcv8jsvarnishvpopmailw32apiwddxweakrefwin32pswin32servicewincachexattrxdiffxhprofxmlxmlreaderxmlrpcxmlwriterxslxsltyafyamlyazzipzlib
Return value
Typestring|false
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.
Changes to the phpversion Function
PHP 8.0
- Return type added:
string|false - Parameter type added for parameter #1 (
$extension):?string - Parameter default value added for position #1 (
$extension):null
- phpversion($extension)
+ phpversion(?string $extension = null): string|false phpversion Function Availability
phpversion Function Availability| PHP Version | Availability |
|---|---|
| PHP 8.6Upcoming Release | Yes |
| PHP 8.5Supported (Latest) | Yes |
| PHP 8.4Supported | Yes |
| PHP 8.3Security-Fixes Only | Yes |
| PHP 8.2Security-Fixes Only | Yes |
| PHP 8.1Unsupported | Yes |
| PHP 8.0Unsupported | Yes |
| PHP 7.4Unsupported | Yes |
| PHP 7.3Unsupported | Yes |
| PHP 7.2Unsupported | Yes |
| PHP 7.1Unsupported | Yes |
| PHP 7.0Unsupported | Yes |
| PHP 5.6Unsupported | Yes |
| PHP 5.5Unsupported | Yes |
| PHP 5.4Unsupported | Yes |
| PHP 5.3Unsupported | Yes |