Re: [PHP] passing a function as a parameter

2004-06-11 Thread Justin Patrin
call_user_func($func) and $func() are much better alternatives. Daniel Clark wrote: Can you use eval() ? I want to pass a function as a parameter and execute it in another function. A callback. :-) For example: function a() { echo "a"; } function b( $func ) { func(); echo "b"; } The ou

Re: [PHP] passing a function as a parameter

2004-06-11 Thread Daniel Clark
Can you use eval() ? > I want to pass a function as a parameter and execute it in another > function. > A callback. :-) > > For example: > > function a() { > echo "a"; > } > > > function b( $func ) { > func(); > echo "b"; > } > > > The output of "b( a )" will be "ab". -- PHP Gener