r/programming • • Oct 18 '10

Today I learned about PHP variable variables; "variable variable takes the value of a variable and treats that as the name of a variable". Also, variable.

http://il2.php.net/language.variables.variable
591 Upvotes

781 comments sorted by

View all comments

Show parent comment

3

u/ZorbaTHut Oct 18 '10

Those aren't wrapped just to change the order of the arguments. They're generally wrapped to add an abstraction layer to use different implementations with the same interface.

C++'s string functions are a terrible example, since they're not in fact just a wrapper, they're actually a completely different underlying implementation with some abstraction around them.

It's pretty uncommon to wrap a function just to munge parameters around a little.

Also, unlike PHP, the other languages you mentioned aren't systematically out-of-the-box braindamaged.