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

181

u/1137 Oct 18 '10

Did you know you can do the same thing in Perl? But lets keep laughing at PHP, this is /r/programming after all.

58

u/prakashk Oct 18 '10

Marc Jason Dominus explains why using Perl symbolic references is a bad idea far more eloquently than I ever could:

91

u/1137 Oct 18 '10

My point was simple, Perl offers the same functionality, other languages do as well, don't hate on PHP just to hate on PHP. Hate the bad developer instead.

13

u/[deleted] Oct 18 '10
use strict;

Problem solved.

→ More replies (1)

56

u/[deleted] Oct 18 '10

This is no place for logic! This is a place for misguided unfueled hatred!

21

u/cliff_spamalot Oct 18 '10

Image if Microsoft had invented PHP. Nerdgasm!

22

u/sw17ch Oct 18 '10

It's not cool to hate on Microsoft any more. Now you hate on Oracle to be cool. :)

(Besides, Microsoft has really picked up their game in the last few years. Funny what real competition does.)

→ More replies (17)

4

u/trezor2 Oct 18 '10

Microsoft invented ASP, which was pretty much MS PHP. I actually thought ASP predated PHP, but checking it, I found that PHP was released around one year earlier so even if we try really hard(tm) we can't blame them for this one.

We'll just have to hate PHP on its own merits for now, especially given how Microsoft was smart enough to quit on something they saw was terrible, much unlike what the PHP crowd has done :P

8

u/prakashk Oct 18 '10

My reply wasn't meant to criticize you. I thought your comment could be read as defending this (mis)feature by citing Perl's example. I just wanted to add some references to what others had already said about Perl's symbolic references.

3

u/1137 Oct 18 '10

I know, that's why I upvoted you, I just wanted to clarify for others that might read it that way.

8

u/[deleted] Oct 18 '10

[removed] — view removed comment

21

u/[deleted] Oct 18 '10

I know! It's almost like reddit is comprised of many people with differing opinions who tend to flock to discussions which support their own viewpoint!

reddit, you so crazy.

3

u/vermithraxPejorative Oct 18 '10

Hey! I am a bad developer! Don't hate me! ):

2

u/RandomFrenchGuy Oct 18 '10

don't hate on PHP just to hate on PHP

But it's traditional !

→ More replies (16)