Re: [PHP] Setting the line number for debugging
Is it possible to set the line number and file name to show in error messages? __FILE__ __LINE__ Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Setting the line number for debugging
As far as I know, __LINE__ and __FILE__ are magic constants which return the current line number and file name. But what I'm looking for is a way to set these two things. I want to say on line 30 that this is not line 30, but line 40 for example. And php should then return all following errors with the new line numbering. The reason for this is that I have a kind of preprocessor which puts some php code parts of code in one large script and then runs the 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. Perl has a nice feature to achieve this, and I was wondering if something similar exists in php. - Thomas Chris Boget [EMAIL PROTECTED] schrieb im Newsbeitrag 008801c24396$580393a0$8c01a8c0@ENTROPY">news:008801c24396$580393a0$8c01a8c0@ENTROPY... Is it possible to set the line number and file name to show in error messages? __FILE__ __LINE__ Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Setting the line number for debugging
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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Setting the line number for debugging
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. Unfortunately none of them. I really put them together in the same file. The reason is that there are many small pieces of code which all together give a complete script. Technically, I could use require/include instead, but this would mean that every generated script consists of a dozen of files. Thank you anyway. - Thomas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php