get_extension_funcs 


php128 apg

GETS an ARRAY with the names of the functions of a module.



<?php

array|false get_extension_funcs string $extension )

where,

$extension Name of the extension to be checked
                          
                          One of the extension names 
                          obtained through the 
function:
                          
get_loaded_extensions 
?>
 

  $extension   


The module name to get the extension functions.




In order to have a complete list of all the functions available in each of the installed extensions, we use get_loaded_extensions which provides the names of said extensions in the format of an ARRAY.


<?php
              
array get_loaded_extensions([ bool $zend_extensions FALSE ] ) 


where

$zend_extensions = if TRUE only return Zend extensions 
                             The 
default, FALSE return regular extensions 

?>
 


So, we use get_extension_funcs to know the names of the functions available in each extension.

Therefore, run the next exercise to see what functions are available in each extension present in your system.

These functions allow for arbitrary-length integers to be worked with using the GNU MP library.

The GMP can be either a GMP OBJECT, an INTEGER or an INTEGER NUMERIC STRING provided that it is possible to convert the latter to a number.

We will study all MATHEMATICS functions available in the gmp extensions.

As this depends on the PHP version, run the next exercises on your system.

   GNU - Multiple Precision  !




  1 EXERCISE   

<table width="100%" cellspacing="3" cellpadding="3" 
border="1" align="center">
<tbody><tr><td colspan="2">AVAILABLE FUNCTIONS</td></tr>
<tr><td>NAME</td><td>LIBRARY</td></tr>
<?php

// The result of this exercise will depend
// of the configuration of your system

$exts get_loaded_extensions ();

foreach ( 
$exts as $xt) {
    
$exts01 get_extension_funcs ($xt);

if( 
$exts01 != FALSE) {
    
foreach ( 
$exts01 as $func ) { 

echo 
'<tr><td>' $func '</td><td>' $xt '</td></tr>';
    
} } }
?>
<tr><td colspan="2">ed48</td></tr></tbody></table> 


  2 EXERCISE   

<?php

$ext 
"gmp";

// The result of this exercise will depend
// of the configuration of your system

// The module name to get the extension functions,
// in this case: gmp (case insentive)

if(extension_loaded($ext))
{
echo 
'<table width="100%" cellspacing="3" 
cellpadding="3" border="1" align="center">
<tbody><tr><td colspan="2">
                AVAILABLE gmp FUNCTIONS</td></tr><tr><td>NAME</td>
<td>EXT</td></tr>'
;

$mod get_extension_funcs ($ext);

foreach ( 
$mod as $k => $xt)
{
echo 
'<tr><td>( ' . ($k+1) . ' ) ' $xt '</td><td>' $ext '</td></tr>';   
}
echo 
'<tr><td colspan="2">ed48</td></tr></tbody></table>';
}
else
{
echo 
'The extension "' $ext '" is NOT loaded!<br>';
exit;
}    

?>



 RESULT   

gmp FUNCTIONS
ORDNAME
1gmp_init
2gmp_import
3gmp_export
4gmp_intval
5gmp_strval
6gmp_add
7gmp_sub
8gmp_mul
9gmp_div_qr
10gmp_div_q
11gmp_div_r
12gmp_div
13gmp_mod
14gmp_divexact
15gmp_neg
16gmp_abs
17gmp_fact
18gmp_sqrt
19gmp_sqrtrem
20gmp_root
21gmp_rootrem
22gmp_pow
23gmp_powm
24gmp_perfect_square
25gmp_perfect_power
26gmp_prob_prime
27gmp_gcd
28gmp_gcdext
29gmp_lcm
30gmp_invert
31gmp_jacobi
32gmp_legendre
33gmp_kronecker
34gmp_cmp
35gmp_sign
36gmp_random_seed
37gmp_random_bits
38gmp_random_range
39gmp_and
40gmp_or
41gmp_com
42gmp_xor
43gmp_setbit
44gmp_clrbit
45gmp_testbit
46gmp_scan0
47gmp_scan1
48gmp_popcount
49gmp_hamdist
50gmp_nextprime
51gmp_binomial
ed48