determine from where the function being called in php
- by Avinash
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.