On Tue, Nov 18, 2003 at 02:03:25PM -0800, david wrote:
: 
: Cpt John W. Holmes wrote:
: 
: > From: "david" <[EMAIL PROTECTED]>
: >> 
: >> if(function_exists($function)){
: >>         eval('$return = $function($input);');
: >> }else{
: >>         // function does not exists
: >> }
: >> 
: >> which works quit nicely for now. not sure if that's a good thing to do.
: > 
: > Why not just do this:
: > 
: > if(function_exists($function))
: > { $return = $function($input); }
: > else
: > { //function does not exist; }
: 
: because i didn't know PHP can do that. thanks for the tip! any differences 
: between the 2 version in turns of performance and safety?

You don't have to invoke eval()), and you don't have to worry about
quoting issues in eval().

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to