Re: [PHP] Re: PHP eval() fatal error

2007-08-27 Thread Richard Lynch
On Mon, August 27, 2007 12:59 am, Maarten Balliauw wrote: > Now let's repeat my question: is there any way to gracefully evaluate > specific code, eventually catch an error and respond to that, without > using parsekit() or launching another process to get this done? I missed that you had an E_ERR

[PHP] Re: PHP eval() fatal error

2007-08-26 Thread Maarten Balliauw
When re-writing this example to a form of "create_function", the same problem occurs: $temporaryCalculationFunction = @create_function('', $code); // E_ERROR here if ($temporaryCalculationFunction === FALSE) { $returnValue = '#N/A'; } else { $returnValue =

[PHP] Re: PHP eval() fatal error

2007-08-20 Thread M. Sokolewicz
Maarten Balliauw wrote: Here's the thing: I'm trying to do some dynamic code compilation within PHP using eval(). The code I'm trying to compile raises an E_ERROR (Fatal). Here's a simple example: Now, I'd like to catch the error made by eval: // ... try { eval($code); } catch (Exception