Get Error Information

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
aliasxneo
Forum Contributor
Posts: 136
Joined: Thu Aug 31, 2006 12:01 am

Get Error Information

Post by aliasxneo »

Is it possible to get information such as line, file, etc. like you would get from an Exception without actually throwing an exception? For instance if I called a function could I find out what line/file that function was called from?

Any input would be helpful, thanks.
User avatar
Oren
DevNet Resident
Posts: 1640
Joined: Fri Apr 07, 2006 5:13 am
Location: Israel

Re: Get Error Information

Post by Oren »

aliasxneo
Forum Contributor
Posts: 136
Joined: Thu Aug 31, 2006 12:01 am

Re: Get Error Information

Post by aliasxneo »

Key word being current. I'm looking more for a reference. For instance:

Code: Select all

 
function test()
{
    // I want to know what line this function was called from //
}
 
test();
In the above case it would have been line 7 that the function was called from. Same goes for the file, the function will be stored in a class that's in a separate file so the file constant wouldn't work either.
Post Reply