This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
I've tested the same file with several different IDEs and NetBeans is the only one (so far) that is unable to locate the source of the issue and point the user to the correct line of code. I didn't think it was a bug at first, but given how every other PHP IDE (Eclipse, etc.) handles the problem correctly, I've begun to suspect that it is. Please look at the supplied link for specifics on the problem. Thanks.
Maybe it's somehow connected with http://netbeans.org/bugzilla/show_bug.cgi?id=168350 ?
(In reply to comment #1) > Maybe it's somehow connected with > http://netbeans.org/bugzilla/show_bug.cgi?id=168350 ? Yes, I think it may be related. Fixing this would make a very good enhancement. A few tests I made: 1 - In this case the line marked is the correct one one: <?php class TEST { private function testfnc($xml) { private $test = ""; // <---- Error } } ?> 2 - If there are more lines after the error the marked line is the wrong one: <?php class TEST { private function testfnc($xml) { private $test = ""; } private function testfnc2($xml) { $test = ""; } // <---- Error } ?> My guess is that the syntax checker doesn't stop at the first error, it attempts to keep parsing the whole code and only the last line that returns error is marked. This makes it very hard to locate the error line in long code. Moreover, the error returned by the syntax checker is rather generic: Syntax error: Unexpected: if, identifier, variable, echo, do, while, [...] While parsing the file with php -l the error is reported is much more precise: PHP Parse error: syntax error, unexpected T_PRIVATE in test.php on line 12 Several other IDEs rely on the php executable to check the code while I assume Netbeans relies on an internal syntax checker. Perhaps netbeans should use both methods and the internal syntax checker could be used in case php is not installed in the system.
The error handling is the first version from 6.5. Needs to be improved.
*** This bug has been marked as a duplicate of bug 211165 ***