PHP defines a few constants and provides a mechanism for defining
more at run-time. Constants are much like variables, but they have a
slightly different syntax.
The pre-defined constants are __FILE__ and __LINE__, which
correspond to the filename and line number being processed when
they are encountered.
Example 6-1. Using __FILE__ and __LINE__
<?php
function report_error($file, $line, $message) {
echo "An error occured in $file on line $line: $message.";
}
report_error(__FILE__,__LINE__, "Something went wrong!");
?>
You can define additional constants using the define() function.
Example 6-2. Defining Constants