2 ms·
How heavily does eval get used in PHP?
by Twirrim 8y ago
How heavily does eval get used in PHP?
- pbiggar 8y agoMore than you'd think. I did some analysis (in 2008 mind you, long time ago, PHP4/PHP5). I think I found that half the packages on sourceforge (sourceforge!) had a use of a dynamic construct. When I looked into it, it wasn't so much eval as dynamic includes, often used for localization: $lang = "en"; include("l18n/$lang.php");
- beberlei 8y agoIt is not used alot in modern code, the only use case that I think is reasonably ok nowadays from and used that way is template engines or config caches in development mode, that usually compile template code to generated PHP files, but eval() immediately during development for simplicity.