Ne zaman (eğer hiç) kötü eval DEĞİLDİR?

0 Cevap php

Possible Duplicate:
When (if ever) is eval NOT evil?

PHP'nin eval işlevi genellikle cevap değil birçok yerde duydum. PHP 5.3 's LSB ve biz eval veya create_function bağlıdır nedenlerle tükeniyor kapanışları ışığında.

Eval PHP 5.3 iyi (tek?) Cevabı akla herhangi bir vaka var mı?

Açıkçası değil gibi Bu soru, eval genel olarak kötü olup olmadığı ile ilgili değildir.

Yanıtlar Özeti:

* Evaluating numerical expressions (or other languages "safe" subsets of PHP)
* Unit testing
* Interactive PHP "shell"
* Deserialization of trusted var_export
* Some template languages
* Creating backdoors for administers and/or hackers
* Compatibility with < PHP 5.3
* Checking syntax (possibly not safe)

0 Cevap