[SOLVED] Show where a function lives?

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
User avatar
infolock
DevNet Resident
Posts: 1708
Joined: Wed Sep 25, 2002 7:47 pm

[SOLVED] Show where a function lives?

Post by infolock »

Ok, I have thousands of files and classes I deal with so I've run into a problem. I need to find out where a variable lives or is defined from. like, where $var was originally defined at (which class, filename, or function). Anyone have any clues?
Last edited by infolock on Tue Jun 07, 2005 2:21 pm, edited 1 time in total.
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

Code: Select all

__FUNCTION__
__CLASS__
__FILE__
Edit:
http://us3.php.net/manual/en/language.c ... efined.php
User avatar
infolock
DevNet Resident
Posts: 1708
Joined: Wed Sep 25, 2002 7:47 pm

Post by infolock »

that only works if it's called from the current file... i found the answer via debug_print_backtrace()
Post Reply