Avatar of Xyptilon2
Xyptilon2Flag for China asked on

Determine from which file a function is called

I have a class with several functions, the class is included on many pages. Without adding a parameter to any of the functions, how can i determine (from within a function in the class) from which file the function was called.

I looked at the magical constant __FILE__ which is interesting, but returns the file of the class.
obviously $_SERVER['PHP_SELF'] and $_SERVER['SCRIPT_NAME'] are not only unreliable, they are also useless.

Any suggestions?

Avatar of undefined
Last Comment

8/22/2022 - Mon

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question

Thank you, the first is what i needed.
Your help has saved me hundreds of hours of internet surfing.