Syntax:string ReflectionExtension::export (string $name, string $return)
Parameters:This function takes two parameters as above and described below: - $name: this parameter contains a reflection export.
- $return:this parameter contains a boolean value. If its value is set to True, it will export the reflected extension. If set to False, then it will not export the reflected extension.
Return Value:This function returns the export as a string if the return option is set to TRUE, otherwise NULL is returned.The following programs illustrate the ReflectionExtension::export() function in PHP:Program_1:
// Definition of the extension
$A
=
’ DOM’
;
// Using ReflectionExtension() above
// specified extension
$extension
=
new
ReflectionExtension (
$A
);
// Calling the export() function
$B
=
$extension
-> export (
$A
,
$return
= FALSE);
// Get the export as a string
var_dump (
$B
);
?>
Output: Extension [ extension # 18 dom version 20031129] { - Dependencies {
Dependency [libxml (Required)]
Dependency [domxml (Conflicts)]
}- Constants [45] {
Constant [integer XML_ELEMENT_NODE] {1}
. ... .
Constant [integer DOM_VALIDATION_ERR] {16}
}
. ... .
. ... .
- Parameters [3] {
Parameter # 0 [< required > $expr]
Parameter # 1 [< optional > DOMNode or NULL $context]
Parameter # 2 [< optional > $registerNodeNS]
}
}Method [ public method registerPhpFunctions] { - Parameters [0] {
}
}
}
}
}
} NULL Program_2:
// Using ReflectionExtension() over
// xml extension
$extension
=
new
ReflectionExtension (
’xml’
);
// Call the export() function and
// Get the export as a string
var_dump (
$extension
-> export (
’xml’
,
$return
= TRUE));
?>
Exit: string (6209) “Extension [ extension # 15 xml version 7.0.33-0ubuntu0.16.04.7] { - Dependencies {
Dependency [libxml (Required)]
}. ... .Function [ function utf8_decode] { - Parameters [1] {
Parameter # 0 [< required > $data]
}
}
}
}
” Link: https://www.php.net/manual/en/reflectionextension.export.php