sleeping
October 11th, 2004, 01:52 PM
Using PHP 4.1.2, is there a function that allows you to print the file line number and the filename where the function is called?
I'd like to have an error reporting tool in the likes of :
// (file lang.php)
24 | switch($language)
25 | {
26 | case 'en' :
27 | // do something
28 | break ;
29 | case 'fr' :
30 | // do something
31 | break ;
32 | default:
33 | print "No language selected in " . print_file_name() . " on line " . print_line_number() . "<BR>\n";
The output would then be :
No language selected in lang.php on line 33
Is such a thing possible in PHP?
I'd like to have an error reporting tool in the likes of :
// (file lang.php)
24 | switch($language)
25 | {
26 | case 'en' :
27 | // do something
28 | break ;
29 | case 'fr' :
30 | // do something
31 | break ;
32 | default:
33 | print "No language selected in " . print_file_name() . " on line " . print_line_number() . "<BR>\n";
The output would then be :
No language selected in lang.php on line 33
Is such a thing possible in PHP?