3 ms·
Rookie question, but what does a language specification for PHP do or mean? I assume this is good, but don't know why. :)
by joshdance 12y ago
Rookie question, but what does a language specification for PHP do or mean? I assume this is good, but don't know why. :)
- x0x0 12y agoThe obvious thing it does is lays the groundwork for multiple first-class implementations. As it stands, the program php essentially is the reference: whatever it does, implementation quirks, bugs, and all, is what php should do.
- Dewie 12y agoWhat is a language, really? It's not really an implementation (necessarily); a language can have multiple implementations, in which you have to ask "which one is the language?" if they have subtly different behaviour. In order to enforce what a language is, you can introduce a specification. This will say that "given a program X, the language will behave like Y". Now any implementation of the language can be checked for conformance. The spec itself might be some document, or perhaps just a "blessed" implementation ("the implementation is the spec").