Or how about an un-closed string? Or forgetting about a semi-colon?
WHen you forget a line terminator, it gives the line number of where it OCCURS, not where the error is.
For example:
<?php
$line1 = 'This is a string for line 3'
.' and this continues from line 3...'
$uhoh = 0;
?>
If you run that code, the error would occur on line 6 ($uhoh = 0) giving an unexpected variable, expecting ";" or "." on line 6. Notice the error isn't IN line six, but it's where PHP found the error occuring.
And just like Laser said, plenty of mismatched {} pairs go uncaught and you just get an unexpected "?>" in the file, and you can't figure out why.
So in essence, line numbers are a reference to start looking. From that point and previous in your code there is something. Sometimes it gives the line the error is on (like if you mis concatenate a string) and sometimes it gives line numbers after the error, but when PHP runs into a problem.
So it can be both ways, and that's the reason. And one more to demonstrate:
Error on line 4, caught on line 6
<?php
<?php
$line1 = 'This is a string for line 3'
.' and this continues from line 3...'
$uhoh = 0;
?>
Error on line 4, caught on line 4
<?php
$line3 = 'So we start our string here'
.' And properly concatenate it until we're here, where we end our string inadvertantly!!
$uhoh = 0;
?>
Notice the difference? So both points can be made true. Line numbers can point to the line in error; however, it is best practice not to assume this and rather use the line number as a reference as to how far down in your code the parser executes before finding an error. From that line number, anywhere previous in your code is suspect.