note 116611 deleted from functions.variable-functions by salathe
| From: | salathe@php.net | Date: | Fri, 06 Feb 2015 13:23:04 +0000 |
| Subject: | note 116611 deleted from functions.variable-functions by salathe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-201634@lists.php.net to get a copy of this message | ||
Note Submitter: catchyouhand at qq dot com
----
Variable functions can work with language constructs such as echo, print. Utilize wrapper functions
to make use of any of these constructs as variable functions.
you can see my example below
<?php
class test{
function doubi(){
return '111111';
}
}
$t = new test();
$func = 'doubi';
echo $t->$func();
echo "\n";
if(empty($t->$func())){
echo "empty functions";
}else{
echo "empty doesn't work";
}
?>
output:
root@ubuntu:/var/www/html/test# php f.php
111111
empty doesn't work