On 28 July 2013 18:36, Robert Cummings <robert(a)interjinn.com> wrote:
I debunked your original comments and you come back
with more false claims
and subjective argumentation.
You debunked my comment that casting is impossible; I concede that I
was wrong. But it is the only context where you are allowed to use
'int'. 'int' isn't a keyword in PHP, '(int)' is. And why?
There is
intval() after all. It's only to match C syntax. It's the same with
new, protected, public, private, etc. keywords for classes, despite
these not really being useful in a interpreted language. The idea is
to catch these issues on compile time, which PHP doesn't have.[0]
Your is_int() solution is correct, but it isn't exactly pretty. It's
another example of 'working against the language'.
As
for why MediaWiki uses PHP... I guess that's what you get when you invent
something-- you get to choose the design and tools.
I don't blame MediaWiki for using PHP. It makes pretty rational sense
at the time it was created. And even if it was created today, it
might have been PHP as well. I have often praised MediaWiki for its
excellent PHP (also notice so does the article I linked to).
[0] I know there are some systems that can compile PHP, but the
primary objective of PHP is not to be compiled.