Why should exec() and eval() be avoided?

后端 未结 11 2108
Happy的楠姐
Happy的楠姐 2020-11-22 00:16

I\'ve seen this multiple times in multiple places, but never have found a satisfying explanation as to why this should be the case.

So, hopefully, one will be prese

11条回答
  •  春和景丽
    2020-11-22 00:56

    eval() and exec() can promote lazy programming. More importantly it indicates the code being executed may not have been written at design time therefore not tested. In other words, how do you test dynamically generated code? Especially across browsers.

提交回复
热议问题