incorrect line numbers reported in compuiler error messages

The PHP compiler apparently displays incorrect line numbers when reporting errors (at least at my web-host) An example - I receive the error message:

 "Parse error: syntax error,   unexpected T_VARIABLE in (document name)  on line 7"

from this code:

Untitled Document <?php $testvar = 1; $testvar = 12; $testvar = 13; $testvar = 14; $testvar = 15; badline // here is the error line $testvar = 17; echo("if this shows program actually works"); ?>

clearly this should say line 13 … obviously this makes debugging almost impossible, with error messages amounting to “an error occurred somewhere (but we won’t tell you where”.

My web host insists this is normal PHP behavior, but I have not seen it until recently

for reverence,
you cxan see this error message at:

webhost is running: PHP version4.4.9
and: Apache version1.3.42 (Unix)

thank you

This behavior seem depend on PHP version.

hmm … any idea which versions do this? (my web host has suggested migrating to version 5)

any idea how people fine an error when the referenced line number is inaccurate?


Sponsor our Newsletter | Privacy Policy | Terms of Service