Entry
When there is an error in PHP, the parser outputs the line number. Is there some function or variable that will output the current line number?
Aug 30th, 2000 18:57
Chris Kings-Lynne, Craig Fratrik, Ben Udall, PHP Manual Chapter 8: Constants
PHP defines several constants and provides a mechanism for defining
more at run-time. Constants are much like variables, save for the two
facts that constants must be defined using the define() function, and
that they cannot later be redefined to another value.
Some predefined constants (always available) are:
__FILE__
The name of the script file presently being parsed. If used within a
file which has been included or required, then the name of the included
file is given, and not the name of the parent file.
__LINE__
The number of the line within the current script file which is being
parsed. If used within a file which has been included or required, then
the position within the included file is given.
eg. report_error(__FILE__,__LINE__, "Something went wrong!");