php8.5
Home/ Manual/ reflection / reflectionconstant/ ReflectionConstant::getExtensionName

ReflectionConstant::getExtensionName

PHP function Edit on GitHub ✎

(PHP 8 >= 8.5.0)

Gets name of the defining extension

Description

ReflectionConstant::getExtensionName(): string|false

Gets the name of the extension which defined the constant.

Parameters Parameters

Return Values

The name of the extension which defined the constant, or false for user-defined constants.

Examples

Basic usage of ReflectionConstant::getExtensionName

php
<?php
var_dump((new ReflectionConstant('SQLITE3_TEXT'))->getExtensionName());
?>

The above example will output:

output
string(7) "sqlite3"

See Also

  • ReflectionConstant::getExtension

Source: reference/reflection/reflectionconstant/getextensionname.xml · from the official PHP manual (php/doc-en)