Re:Announcing a specification for PHP
by aruggirello on Thursday July 31, 2014 @08:59AM
(#8113777)
You're talking about the very things that make PHP flexible.
I don't see how 'swapping out' things like these would make PHP any safer, faster, or easier to read. C/C++ function decorators, or dynamic programming constructs are not exactly that clearer.
[ Parent
| on HN ]
Re:Announcing a specification for PHP
by chriswarbo on Thursday July 31, 2014 @09:46AM
(#8113998)
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.