PHP | ReflectionExtension getDependencies() Function
Last Updated :
19 Dec, 2019
The ReflectionExtension::getDependencies() function is an inbuilt function in PHP which is used to return an array with dependencies as keys and either Required, Optional or Conflicts as the values.
Syntax:
array ReflectionExtension::getDependencies( void )
Parameters: This function does not accept any parameter.
Return Value: This function returns an associative array containing the dependencies as keys and either Required, Optional or Conflicts as the values.
Below programs illustrate the ReflectionExtension::getDependencies() function in PHP:
Program 1:
<?php
$A = 'DOM' ;
$extension = new ReflectionExtension( $A );
$B = $extension ->getDependencies();
var_dump( $B );
?>
|
Output:
array(2) {
["libxml"]=>
string(8) "Required"
["domxml"]=>
string(9) "Conflicts"
}
Program 2:
<?php
$extension = new ReflectionExtension( 'xml' );
var_dump( $extension ->getDependencies());
?>
|
Output:
array(1) {
["libxml"]=>
string(8) "Required"
}
Reference: https://www.php.net/manual/en/reflectionextension.getdependencies.php
Share your thoughts in the comments
Please Login to comment...