Re: Line number of error
| From: | Jonathan Hilgeman | Date: | Thu, 06 Sep 2001 20:42:42 +0000 |
| Subject: | Re: Line number of error | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-66275@lists.php.net to get a copy of this message | ||
Nevermind - found the answer. The current line number is held in the
constant __LINE__ and the current file name is held in the constant __FILE__
So I can do the following:
print "this is line " . __LINE__ . " in the file " . __FILE__;
- Jonathan
"Jonathan Hilgeman" <jhilgeman@ecx.com> wrote in message
news:20010906204539.78548.qmail@pb1.pair.com...
> Is there any way to print the current line number? i.e.
>
> 43 print "blah";
> 44 print "this is line $LineNumber";
> 45 print "etc";
>
> and have it result in :
> blahthis is line 44etc
>
> ?
>
> - Jonathan
>
>