3 ms·
Sure, but that has little to do with the reflection api. PHP is unique among its class of languages (counting Ruby, Python, Perl etc.) in that it has an extrem
by troels 16y ago
Sure, but that has little to do with the reflection api.
PHP is unique among its class of languages (counting Ruby, Python, Perl etc.) in that it has an extremely dynamic runtime, but yet keeps the compiletime/runtime distinction known from compiled languages, such as Java.
I have a love/hate relationship to that. On one hand it feels stupid and restrictive compared to more thought-out languages such as Scheme, Javascript or ruby, but on the other hand it _does_ instil some stability in an environment that is quite chaotic in other respects (dynamic-weak typing has some confusing edge cases, just to name one). I'm not sure it's such a bad balance after all.
- eru 16y ago> but yet keeps the compiletime/runtime distinction Could you elaborate on that? I don't see what you mean. Interestingly, Python usually also gets compiled---though the target language (Python's byte code) is still very dynamic.
- troels 16y agoI meant semantically, not literally. PHP has a class based object model that is basically copied from Java. One of the more absurd results of this transplantation is that in PHP, classes can implement static interfaces. This is useful in Java, to imbue some flexibility into the otherwise very rigid static typing, but in PHP it's utterly backwards. As an aside, PHP gets compiled into opcode before interpretation, but the two processes are usually not separated. This is true for most interpreted languages actually.