Justtechjobs.com Find a programming school near you






Online Campus Both


php-general | 2001072

[PHP] references From: scott [gts] (scott <email protected>)
Date: 07/31/01

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.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe <email protected>
For additional commands, e-mail: php-general-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>