RE: [PHP] how to trap eval error?

2003-11-18 Thread Jay Blanchard
[snip] eval('$return = $function($input);'); [/snip] The problem is the quotes...the string is not truly being eval'd. Change to double quotes eval($return = $function($input);); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] how to trap eval error?

2003-11-18 Thread david
Jay Blanchard wrote: [snip] eval('$return = $function($input);'); [/snip] The problem is the quotes...the string is not truly being eval'd. Change to double quotes eval($return = $function($input);); thanks for the tip but i am sure you mean: eval(\$return = \$function(\$input););

Re: [PHP] how to trap eval error?

2003-11-18 Thread CPT John W. Holmes
From: david [EMAIL PROTECTED] i found a solution (hopefully) with: 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:

Re: [PHP] how to trap eval error?

2003-11-18 Thread david
Cpt John W. Holmes wrote: From: david [EMAIL PROTECTED] i found a solution (hopefully) with: 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

Re: [PHP] how to trap eval error?

2003-11-18 Thread Eugene Lee
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

Re: [PHP] how to trap eval error?

2003-11-18 Thread CPT John W. Holmes
From: david [EMAIL PROTECTED] Cpt John W. Holmes wrote: From: david [EMAIL PROTECTED] i found a solution (hopefully) with: if(function_exists($function)){ eval('$return = $function($input);'); }else{ // function does not exists } which works quit nicely for