Re: Setting the line number for debugging
| From: | Chris Boget | Date: | Wed, 14 Aug 2002 14:42:49 +0000 |
| Subject: | Re: Setting the line number for debugging | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-112542@lists.php.net to get a copy of this message | ||
> As far as I know, __LINE__ and __FILE__ are "magic constants" which
> return the current line number and file name.
Sorry, I misunderstood exactly what you were looking for.
> whole script. If now an error occurs on line 362 for example, it is
> not easy to find the buggy code part, because this might be on line
> 15 in one of the source scripts.
How do you include the source scripts into the main scripts? By using
include() or require()? IIRC, __LINE__ and __FILE__ should work in
cases like that telling you the line and file name of the source script,
not the main script.
> Perl has a nice feature to achieve this, and I was wondering if
> something similar exists in php.
Apart from those two variables, none that I know of. Though, that's not
to say something similar doesn't exist.
Chris