2 ms·
Nobody's talking about "swapping out" the eval-like features. The parent was saying we could swap out all usages of 'old fashioned' functions like str_replace
by chriswarbo 12y ago
Nobody's talking about "swapping out" the eval-like features.
The parent was saying we could swap out all usages of 'old fashioned' functions like str_replace for some 'new fashioned' alternative, like String::replace, using some kind of upgrader tool.
I was pointing out that the PHP's eval-like features make it difficult for any such tool to exist. In particular, with Python or Javascript we might spit out a warning "Eval spotted; this upgrade might not work!". If we did the same in PHP, everyone would get a warning! "String used as function detected; this upgrade might not work!", "Variable variable detected; this upgrade might not work!", and so on.