references
| From: | scott [gts] | Date: | Tue, 31 Jul 2001 20:04:09 +0000 |
| Subject: | references | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-60499@lists.php.net to get a copy of this message | ||
i've been reading over the docs on references, and i
can't see anyway to pass around functions as references.
i know how to do this easily with perl, but i cannot
seem to find the correct syntax for creating a reference
to a function in PHP.
what i'd like to do is something like this:
// X is now a reference to test()
// but i dont want test() to be executed now
$x =& test();
// Now, i want to execute test() with
// something like this and see "Hello World"
&$x();
function test() {
print "Hello World";
}
any and all help is appreciated.
thanks a lot.