What situations demand the use of eval() because there are no alternatives?

后端 未结 5 1713
小蘑菇
小蘑菇 2021-01-18 00:07

I know eval should be avoided in JavaScript for speed and security reasons. But in the case of PHP, rarely is security ever mentioned. More often, it\'s your pr

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-18 00:18

    If you want to use anonymous functions prior to PHP 5.3, you need to use create_function, which wraps an eval() call.

提交回复
热议问题