php8.5
Home/ Manual/ reflection / reflectionextension/ ReflectionExtension::__construct

ReflectionExtension::__construct

PHP function Edit on GitHub ✎

(PHP 5, PHP 7, PHP 8)

Constructs a ReflectionExtension

Description

ReflectionExtension::__construct(string $name)

Construct a ReflectionExtension object.

Parameters

name

Name of the extension.

Errors/Exceptions

Throws ReflectionException if the extension to reflect does not exist.

Examples

ReflectionExtension example

php
<?php
$ext = new ReflectionExtension('Reflection');

printf('Extension: %s (version: %s)', $ext->getName(), $ext->getVersion());
?>

The above example will output something similar to:

output
Extension: Reflection (version: 8.3.17)

See Also

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