Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Line number in source file

0 views
Skip to first unread message

Steve Garcia

unread,
Apr 24, 2002, 9:54:59 PM4/24/02
to
I'd like to be able to 'echo' something in a string that would include
the line number of the source file.

Something along the lines of:

echo "thisvar is '$thisvar' at __LINENO__";

Most C compilers that I've worked with have something like this. I just
can't believe there isn't something along these lines in PHP. It would
make basic debugging a lot easier.

Anybody know of such a thing?

Henrik Hansen

unread,
Apr 25, 2002, 3:50:49 AM4/25/02
to
"Steve Garcia" <sgarcia-at...@ignore.com> wrote:

__LINE__

--
Henrik Hansen

The alt.php faq: http://www.alt-php-faq.org/

Steve Garcia

unread,
Apr 28, 2002, 7:17:57 PM4/28/02
to
In article <87r8l4t...@server.server>, "Henrik Hansen"
<hhS...@fsck.dk> wrote:

> > Something along the lines of:
>>
> > echo "thisvar is '$thisvar' at __LINENO__";

> > Anybody know of such a thing?
> __LINE__


Thanks! I couldn't find it in the docs.

Steve

Andreas Hjordt

unread,
Apr 28, 2002, 8:30:50 PM4/28/02
to
"Henrik Hansen" <hhS...@fsck.dk> wrote in message
news:87r8l4t...@server.server...

> "Steve Garcia" <sgarcia-at...@ignore.com> wrote:
>
> > I'd like to be able to 'echo' something in a string that would include
> > the line number of the source file.
> >
> > Something along the lines of:
> >
> > echo "thisvar is '$thisvar' at __LINENO__";
> >
> > Most C compilers that I've worked with have something like this. I
just
> > can't believe there isn't something along these lines in PHP. It would
> > make basic debugging a lot easier.
> >
> > Anybody know of such a thing?
>
> __LINE__
>

Can you please provide a url where constants like __LINE__ are documented?

best regards,
Andreas Hjordt

Henrik Hansen

unread,
Apr 29, 2002, 3:25:02 AM4/29/02
to
"Andreas Hjordt" <a...@SPAMtrition.dk> wrote:

http://dk.php.net/manual/en/language.constants.php (and the subpages).

Andreas Hjordt

unread,
Apr 29, 2002, 8:33:13 AM4/29/02
to
"Henrik Hansen" <hhS...@fsck.dk> wrote in message
news:873cxfd...@server.server...

Thanks.

Ewoud Dronkert

unread,
Apr 29, 2002, 11:34:26 AM4/29/02
to
"Andreas Hjordt" <a...@SPAMtrition.dk> wrote:
> Thanks.

Thanks for quoting the entire discussion.

Andreas Hjordt

unread,
Apr 29, 2002, 6:20:11 PM4/29/02
to
"Ewoud Dronkert" <nos...@invalid.info> wrote in message
news:3ccd6845$0$306$e4fe...@dreader1.news.xs4all.nl...

> "Andreas Hjordt" <a...@SPAMtrition.dk> wrote:
> > Thanks.
>
> Thanks for quoting the entire discussion.
>

np.

0 new messages