Hello.
I want to make a small function that sends a debug message:
function debuginfo($msg)
{
echo"the message is $msg, at line" . __LINE__ . " ";
}
in my code:
line 1
line 2
line x: debuginfo("hello!!!");
is there is anyway to show the caller's line number? in this case 'x' ?
--
On Wed, 28 Feb 2001, Christian Dechery wrote:
>
> >Pass __LINE__ to the function as one of its arguments:
> >
> > function debuginfo($msg, __LINE__)
> > {
> >echo"the message is $msg, at line" . __LINE__ . " ";
> > }
>
> that won't work since __LINE__ returns the exact line where it's u
>Pass __LINE__ to the function as one of its arguments:
>
> function debuginfo($msg, __LINE__)
> {
>echo"the message is $msg, at line" . __LINE__ . " ";
> }
that won't work since __LINE__ returns the exact line where it's used... so
it will always show the line of the function header..
-
From: CC Zona [mailto:[EMAIL PROTECTED]]
Sent: 28 February 2001 09:37
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Caller's __LINE__
In article <97ifmk$p85$[EMAIL PROTECTED]>,
[EMAIL PROTECTED] ("elias") wrote:
> function debuginfo($msg)
> {
> echo"the m
In article <97ifmk$p85$[EMAIL PROTECTED]>,
[EMAIL PROTECTED] ("elias") wrote:
> function debuginfo($msg)
> {
> echo"the message is $msg, at line" . __LINE__ . " ";
> }
>
> in my code:
> line 1
> line 2
> line x: debuginfo("hello!!!");
>
> is there is anyway to show the caller's line n
Hello.
I want to make a small function that sends a debug message:
function debuginfo($msg)
{
echo"the message is $msg, at line" . __LINE__ . " ";
}
in my code:
line 1
line 2
line x: debuginfo("hello!!!");
is there is anyway to show the caller's line number? in this case 'x' ?
--
6 matches
Mail list logo