Change language

PHP ReflectionFunction export ()

|
Syntax:
string ReflectionFunction::export (string $name, string  $return)
Parameters:This function takes two parameters as above and described below:
  • $name: is the specified function to be exported.
  • $return:is the boolean value TRUE or FALSE. If its value is set to True, then it will be exported, and if its value is set to false, then it will return NULL. False is the default.
Return Value:This function returns the export as a string if the return parameter is TRUE, otherwise NULL is returned.The following programs illustrate the ReflectionFunction::export() function in PHP:Program 1:  
// Initialize a custom function function Company ( $Company_Name , $Role ) { return sprintf ( "% s% s " ,
$Company_Name , $Role ); }  
// Using ReflectionFunction() on the specified company function $function = new ReflectionFunction ( ’company’ );  
// Calling the export() function $A = $function -> export (Company, $return = TRUE);  
// Get the export as a string echo $A ; ?>
Output:
Function [< user > function Company] {@@ /home/b38c7d194c961e6b0d1d5b1c6e582d19.php 4 - 7 - Parameters [2] {Parameter # 0 [< required > $Company_Name] Parameter # 1 [< required > $Role]}}
Program 2:  
// Initialize some custom functions function Trial1 ( $First_Args , $Second_Args ) { return sprintf ( "% s% s" , $First_Args , $Second_Args ); } function Trial2 ( $First_Args , $Second_Args ) { return sprintf ( "% s% s" , $First_Args , $Second_Args ); }  
// Using ReflectionFunction() on the above functions $function1 = new ReflectionFunction ( ’Trial1’ ); $function2 = new ReflectionFunction ( ’Trial2’ );  
// Call the export() function and
// Get the export as a string echo $function1 -> export (Trial1, $return = TRUE); echo $function2 -> export (Trial2, $return = FALSE); ?>
Exit:
Function [< user > function Trial1] {@@ /home/2410abe3ca2b5235249f9a0c9ba035b4.php 4 - 7 - Parameters [2] {Parameter # 0 [< required > $First_Args] Parameter # 1 [< required > $Second_Args]}} Function [< user > function Trial2] {@@ /home/2410abe3ca2b5235249f9a0c9ba035b4.php 9 - 12 - Parameters [2] {Parameter # 0 [< required > $First_Args] Parameter # 1 [< required > $Second_Args]}}
Link: https://www .php.net / manual / en / reflectionfunction.export.php

Shop

Best laptop for Sims 4

$

Best laptop for Zoom

$499

Best laptop for Minecraft

$590

Best laptop for engineering student

$

Best laptop for development

$

Best laptop for Cricut Maker

$

Best laptop for hacking

$890

Best laptop for Machine Learning

$950

Latest questions

NUMPYNUMPY

psycopg2: insert multiple rows with one query

12 answers

NUMPYNUMPY

How to convert Nonetype to int or string?

12 answers

NUMPYNUMPY

How to specify multiple return types using type-hints

12 answers

NUMPYNUMPY

Javascript Error: IPython is not defined in JupyterLab

12 answers

Wiki

Python OpenCV | cv2.putText () method

numpy.arctan2 () in Python

Python | os.path.realpath () method

Python OpenCV | cv2.circle () method

Python OpenCV cv2.cvtColor () method

Python - Move item to the end of the list

time.perf_counter () function in Python

Check if one list is a subset of another in Python

Python os.path.join () method