Re: Re: Setting the line number for debugging
| From: | Sean McCann | Date: | Wed, 14 Aug 2002 15:13:01 +0000 |
| Subject: | Re: Re: Setting the line number for debugging | ||
| References: | 1 2 3 | Groups: | php.lang |
| Request: | Send a blank email to php-lang+get-357@lists.php.net to get a copy of this message | ||
> __FILE__ and __LINE__ will *get* the information, but not *set*
>
> there is no equivalent to Perl or C #file and #line
Thank you for clarifying my misinterpretation of the original question.
Nevertheless, even though there are no PHP language mechanics analogous to
Perl's #line, there are still workarounds using __LINE__.
For example:
$line_mod = 1 - __LINE__; // Set the current line to "Line 1"
// 100 lines later....
echo "Modified line number is ".(__LINE__+$line_mod);
// Outputs "Modified line number is 101"