Michael Fesser wrote:
.oO(2metre)
Sundial Services wrote:
I consider this to be a PHP bug, however, because the compiler should have
caught the fact that only one parameter is permitted to this function. And
and which compiler would that be?
PHP compiles the code before executing it.
Micha
I accept that the definition of compiler is open to debate.
I was using the concept that 'compiling' infers converting the entire
'human-readable' source file into a 'machine-readable' executable file (
which can then be 'run'). By this definition, PHP is not a compiler.
Using the definition favoured by you and the OP:
With an interpreted language like PHP, if a function is never called or
an object/class definition never used, it doesn't get compiled.
With a proper compiler (by my earlier def), an unused function will be
compiled, but may then be removed by a later optimisation stage (either
in the compiler or the linker).