[pmwiki-users] Irreproducible behavior - maybe a bug

Joachim Durchholz jo at durchholz.org
Wed May 11 12:46:09 CDT 2005


Radu wrote:
> So how about eval(), folks?

eval() forces the PHP engine into parsing the string again. In normal 
interpreted code that's not a real issue, but I've read rumors that this 
plays very badly with optimisers like the Zend engine.

The other thing is that syntax errors in the eval()ed code will abort 
the entire script. And it's far too easy to create invalid PHP code - a 
backslash too little or too many before a quote can be all that it takes.

So I agree with Patrick and try to avoid it if I can.

There's also this saying: "if eval() is the answer, you probably asked 
the wrong question." It's a saying that I wholeheartedly agree with, 
though I can't say exactly why. It's just that eval() and its moral 
equivalents in other languages have bitten me far too often :-)

Regards,
Jo



More information about the pmwiki-users mailing list