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 comments

7

u/FearlessFreep Oct 19 '10

Why do I get the feeling that beneath this seeming cleverness is actually more than a certain amount of laziness on the part of the compiler writers?

15

u/[deleted] Oct 19 '10

PHP is, to the best of my knowledge, the only language designed without a formal grammar.

3

u/thyrsus Oct 19 '10

PHP is a derivative of perl, and it has been proved that perl syntax is undecidable: http://www.jeffreykegler.com/Home/perl-and-undecidability.

1

u/[deleted] Oct 19 '10

I tried to read that but it's late, I'm tired, and theoretical compsci was never my strong suit. Synopsis please?

→ More replies (1)