determine from where the function being called in php

Posted by Avinash on Stack Overflow See other posts from Stack Overflow or by Avinash
Published on 2010-12-28T05:40:42Z Indexed on 2010/12/28 5:54 UTC
Read the original article Hit count: 222

Filed under:
|
|
|

I have one function on my code. say its xyz().

This function is being called from different files of my project.

Is there any way than I can get from where the function is being called.

I want below infromation:

File name from where its called. Line
number of that file. if call is from
inside the function then that function
name. Class name Class method name.

I know about use of magic constants like FILE and all that. but i don't want to pass all that in function call. like below:

xyz('msg',__FILE__,__CLASS__);

is there any way that i have to pass just my error related data only. and it will find the above details from where the function is called.

let me know if anything is not clear.

© Stack Overflow or respective owner

Related posts about php

Related posts about php5