You are here: php equivalent to printf("%d\n",__LINE__); « PHP Programming Language « IT news, forums, messages
php equivalent to printf("%d\n",__LINE__);

Posted by salmobytes on 01/31/08 22:21

In C you can make debug statments that announce the current
line number in the source, with something like:
printf("%d\n",__LINE__);

php (if php.ini is setup that way) often announces
line numbers when catching errors.

How can you do echo the equivalent of C's __LINE__ macro
on non-error but interesting debugging conditions?

If ($checkbook-balance < $100 && $subject == "wife")
echo sys_sourceline(), "<br>"; ....or some such

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация