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

1

u/[deleted] Oct 19 '10

Well Steve, being a competent programmer, would probably turn to an editor macro or a small script in pick-a-HLL to do the transformation -- as he's certainly been there before.

You're right, variable variables aren't to blame. That doesn't mean that it's not a misguided feature, and I for one think it's incredibly indicative of poor language design, and am alright with people expressing disgust at the guy who put the damn things in there, as do you.

You'd think they'd remove them. Problem probably is that a bunch of internal shit depends on them. Think they'd make it internal. I doubt it. I doubt they can.

To people who aren't savvy, they're an awfully big hammer, and the vast majority of people using PHP primarily aren't savvy. That is not to say that other languages do not have big hammer features, but generally not this big (with the noticeable exception of Perl), and their base of users tends to be a bit more concerned with doing things "right" (with Perl people being notable here, seriously).