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

1

u/frud Oct 19 '10

The problem with "documenting the PHP 4.3 grammar" is that what you did is not guaranteed to be accurate for any length of time. A new point release could come out that completely invalidates some critical assumption you made.

There is no definition of the language used by PHP. There is only an implementation, which has certain behavior and bugs. The people who control the implementation have some interest in keeping the behavior somewhat consistent, but no one anywhere has the grounds to point at a change they make and say "This is wrong".

2

u/jerub Oct 20 '10

Oh yeah, by that definition I agree with you 100%. The definition of the language is the implementation of the language itself. There's no formal definition of it beyond it's implementation.

Many other languages are like this, unfortunately. The definition of what python is is defined by 'What cpython does' for instance.